LOGGER
Logger
Data Logging using ESP8266
|
Go to the source code of this file.
Macros | |
#define | LED_PIN 0 |
< version of this include file More... | |
#define | ONEWIRE_PIN 0 |
The pin that is used for the OneWire interface. | |
#define | I2C_SDA_PIN 4 |
SDA. More... | |
#define | I2C_SCL_PIN 2 |
SCL. | |
#define | NOT_DATA_READY 5 |
#define | FLASH_SS_PIN 16 |
#define | FLASH_RESET_PIN 0 |
Setup for the RESET pin. More... | |
#define | FLASH_CS_PIN 2 |
Setup for the CS pin. | |
Huzzah pins and how they are used
#define FLASH_RESET_PIN 0 |
Setup for the RESET pin.
On the HUZZAH pins are used to support Onewire, SPI and I2C.
GPIO #0, which does not have an internal pullup, and is also connected to both a mini tactile switch and red LED. This pin is used by the ESP8266 to determine when to boot into the bootloader. If the pin is held low during power-up it will start bootloading! That said, you can always use it as an output, and blink the red LED. Huzzah doc says it should be used as an output.
GPIO #2, is also used to detect boot-mode. It also is connected to the blue LED that is near the WiFi antenna. It has a pullup resistor connected to it, and you can use it as any output (like #0) and blink the blue LED.
GPIO #15, is also used to detect boot-mode. It has a pulldown resistor connected to it, make sure this pin isn't pulled high on startup. You can always just use it as an output.
GPIO #16 can be used to wake up out of deep-sleep mode, you'll need to connect it to the RESET pin
GPIO0 should only be used as an output, does not support a pullup tied to the red LED, Used for OneWire GPIO2 (has pullup) GPIO3 GPIO4 SDA also pulse count 0 GPIO5 SCL also pulse count 1 GPIO12 MISO GPIO13 MOSI GPIO14 SCLK GPIO15 SPI chip select for the SD flash GPIO16 Pinning of the Teensy SD card module
top is the card insertion SS is chip select, SW is the card insertion sensor which requires a jumper to be active.
card
GND PWR (5V or 3V based on 'jumper') SS n/c SCLK n/c MOSI n/c MISO SW
#define FLASH_SS_PIN 16 |
The SS pin on the small PJRC module interferes with normal boot of an ESP8266 when it is connected to pin 15. The SD card chip select has been moved to pin 16 to avoid this issue. Pin 15 is what was used as SS in the original pins_arduino.h. The value from pins_arduino.h is not used, the value defined here is used by properly initializing the SD library in the flash support code.
#define I2C_SDA_PIN 4 |
SDA.
Pinning for I2C clock and data.
Pin 2 is used for clock because clock is compatible with the involvement of pin 2 in boot mode detection. This is benign since the clock is controlled by the master. Slaves can stretch the clock by grounding it for a short time. Clock stretching only occurs when the slave is active and thus will not bother boot mode.
#define LED_PIN 0 |
< version of this include file
Looking at the Huzzah with the programming connector at the bottom pins facing up (printed case up). SPI and I2C annotations are from pins_arduino.h
RST TX A RX EN #5 Not Data Ready / PULSE_PIN_2 16 SS (wakeup involvement) #4 SDA / PULSE_PIN_1 14 SCK #0 OneWire 12 MISO #2 SCL (has pullup) 13 MOSI 15 (has pulldown) V+ 3V VBAT LDO GND GND NC TX RX V+ NC GND This pin is toggled to show when a sample is taken. It may also be blinked in patterns to show other status.
#define NOT_DATA_READY 5 |
Not Data Ready
Any sensor module can pull this line low to indicate that it wants attention. When the line is low the processor fields an interrupt and services all possible sensor modules.