Git Product home page Git Product logo

arduino-ds3231-setup's Introduction

Arduino sketch to setup RTC clock (DS3231)

This repo can be used to setup RTC clock (DS3231). The sketch includes a simple AT based serial communication protocol that can be used to set the time.

The solution can be embedded into existing projects if serial line is not very busy and enough flash space is available. In the other case just flash it once, setup the clock and then flash your project.

Usage

Upload the sketch:

pio run -t upload -e nano

Note: specify your board or add a new board if not present on a list.

Read serial device associated with your board:

cat /dev/cu.usbserial-1420

Note: make sure to use appropriate serial device

In a separate shell run commands below:

# To test if all good. You should see OK as an output
echo -e "AT" > /dev/cu.usbserial-1420

# Set current date 
echo -e "AT+TIME=$(date +%s)" > /dev/cu.usbserial-1420

# Set time zone
echo -e "AT+ZONE=$(date +%z)" > /dev/cu.usbserial-1420

# Show actual time value
echo -e "AT+TIME" > /dev/cu.usbserial-1420

Or just use script

bin/set-time.sh /dev/cu.usbserial-1420

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.