Working with D1 Mini NodeMCU ESP8266
Though the NodeMCU can be programmed on the Arduino IDE, I went with VSCode and PlatformIO Embedded Systems Framework.
Project Creation Parameters:
Board: WeMos D1 mini ESP8266
Framework: Arduino
The PlatformIO has a very different (Git like) folder structure:
platformio.ini holds the initial configuration files
src holds the main source code
lib folder is used to install the dependent libraries
Platformio.ini:
Platform: which corresponds to the SoC used by the board.
Board: the development board you’re using.
Framework: the software environment that will run the project code.
SD Card Reader (Insights)
SD Card Reader Module Pinout:
Slave Select (pin) = SS = CS = Chip Select (pin)
Serial Clocl Line (pin) = SCL = CLK = Clock (pin)
MOSI = sends bits from master to slave
MISO = sends bits from slave to master
Library Used: Built-in
Github Link. Repository Name: esp8266
Use board architecture specific library. Will cause errors otherwise.
Real Time Clock: DS1307 (Insights)
RTC has 2 chips
DS1307 for RTC [P2 Side of the module]
EEPROM Flash Memory to store data [P1 Side of the module]
Open and close the file in the void loop() after writing to avoid data corruption.
Use different CLKs for different components over I2C.
Library Used: RTClib by Adafruit
Github Link. Repository Name: adafruit/RTClib
Module Pin-out explanation
Module Pin-out explanation
Use board architecture specific library. Will cause errors otherwise.