EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / RTC-DS3231 C++ PROGRAMMING HELP ON RPI 3

RTC-DS3231 C++ PROGRAMMING HELP ON RPI 3

|

Microcontroller › Raspberry Pi › RTC-DS3231 C++ PROGRAMMING HELP ON RPI 3

  • This topic has 1 reply, 2 voices, and was last updated 6 years, 4 months ago by Sabin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 30, 2017 at 7:44 pm #4684
    Khalid
    Participant

    Hi everyone,

    Can anyone please help me in C++ code for RTC DS3231. I have the arduino code but I am struggling in changing the syntax on Raspberry pi as I am a beginner.

    I am trying to create classes for writing time, alarms and set the square wave.

    Thanks in advance.

    December 28, 2018 at 9:45 am #14993
    Sabin
    Participant

    For module setup try the following shell commands –
    sudo apt-get update
    sudo apt-get -y upgrade
    Now modify a system file using :
    sudo nano /etc/modules
    If it isn’t already there add “rtc-ds1307” to the bottom so it looks something like :
    snd-bcm2835
    i2c-bcm2835
    i2c-dev
    rtc-ds1307

    For I2C device –
    sudo nano /etc/rc.local
    Add the following two lines before the exit 0 line :
    echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
    hwclock -s
    Then
    sudo reboot
    sudo raspi-config
    Then add date –
    sudo date -s "28 DECEMBER 2018 13:00:00"
    sudo hwclock -w
    sudo hwclock -r

    Thats all

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Need Help Figuring Out the Schematics Of Circuit Board May 13, 2025
  • Wish to buy Battery, Charger and Buck converter for 12V , 2A router May 12, 2025
  • applying solder paste from a jar May 12, 2025
  • Question i-nears headphones magnetic drivers May 12, 2025
  • An Update On Tarrifs May 12, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise