This repository contains examples of using DS3231 driver - ds3231_driver.
git clone --recursive https://github.com/HexRx/ds3231_driver_examples.git
- Do the below steps depend on your platform to compile the example.
The example uses OpenOCD + ST-Link for flashing. P0.6 pin as UART TX debug see the variable NRF_LOG_BACKEND_UART_TX_PIN
in config/sdk_config.h
.
- Go to the directory
nrf52832
. - Change the
SDK_ROOT
variable to your path of nRF5 SDK in theMakefile
. - Change
SDA_GPIO
andSCL_GPIO
for your I2C pins inmain.c
. By defaultSDA_GPIO
= 26 (P0.26) andSCL_GPIO
= 27 (P0.27). - Run
make flash
to compile the code and flash in MCU.
The output to UART should be like:
<info> app: App started.
<info> app: 2000-01-01 01:31:16
<info> app: 25.50 deg Cel
<info> app: 2000-01-01 01:31:17
<info> app: 25.50 deg Cel
<info> app: 2000-01-01 01:31:18
This project is licensed under the MIT License - see the LICENSE file for details.