Serial.begin(115200) //Starts serial connection So, we use the library shown in figure 3 which, as stated in the description, is tested on the ESP8266. Software LibraryĪs usual, the Arduino Environment provides a wide range of libraries to interface with different devices, and the DS3231 is no exception. The tests were performed using a NodeMCU board, a very cheap and easy to use ESP8266 board. If you are using a NodeMCU board, take into consideration that the board pins don’t correspond to the ESP8266 pins (check here the correct mapping). Since we are using the Arduino IDE, we have the Wire library available to handle the I2C protocol in the ESP8266, which we will later use when creating the program to interact with the RTC.Īs described in the documentation of the ESP8266 libraries for the Arduino IDE, the default pins for the I2C in the Wire library are pins 4 (SDA) and 5 (SDL). Figure 2 – Connection diagram between the ESP8266 and the DS3231.Īs can be seen in the diagram, the DS3231 uses an I2C interface to interact with microcontrollers.
0 Comments
Leave a Reply. |