The Digispark > Digispark Libraries

DS1307 RTC library

(1/2) > >>

ngoline:
Hi, I've looked everywhere but couldn't find a library to work with a Real Time Clock on Digispark, so I've decided to modify what I found and make it work my way.


I put out this project on GitHub (http://github.com/nGoline/TinyRTClib).

It's based on Adafruit's project also on GitHub (http://github.com/adafruit/RTClib).
I've changed it to point to TinyWireM instead of Wire and made some modifications to the methods that call Wire 'cause in the TinyWireM library they have different methods like Wire.write() is actually TinyWireM.send()...

In the examples we have 3 codes. The softrtc is meant to run by the first time you put the batteries on, from that point you'll have as long as 9 years of correct Date and Time.

Enjoy!

Níckolas Goline

SmeeAgain:
Nice job! Are you using pull-ups on the I2C lines? So far I've only used the 1307 on the Arduino and there it works fine without additional pull-ups.

Mark:
Folks
I2C needs pullups because the devices are open collector or Tri State.

Stick them in as a matter of design practice.

You only need one set either at the master, or in some designs at the device.


Mark

ngoline:
I'm using them with the "Digispark LCD Shield" and the shield already have the pull ups.
I've also made some modifications to the library and will post it latter today.

digistump:
This is now also included in the official release. http://digistump.com/wiki/digispark/tutorials/connecting#software

Navigation

[0] Message Index

[#] Next page

Go to full version