Internet of Things Programming with JavaScript
上QQ阅读APP看书,第一时间看更新

Connecting an RTC

To control a system, it is very important to have a circuit that can read the time; it can help control the outputs from the Raspberry Pi or detect an action at a specific time. We will interface an RTC module DS3231 with the Raspberry Pi.

I2C setup

The first step is to enable the I2C interface by performing the following steps:

  1. Select Advanced Options:
    I2C setup
  2. Enable the I2C option, as shown in the following screenshot:
    I2C setup
  3. Select <Yes> on the next screen:
    I2C setup
  4. Select <Ok>:
    I2C setup
  5. Then select <Yes>:
    I2C setup
  6. Next, select <OK>:
    I2C setup