A Real Time Clock program using the PCF8583_rtc library with IRremote control. The output is to my 4 digit Nixie display which uses a simple I2c BCD interface
Dependencies: PCF8583_rtc mbed
Revision 3:07c00c82338c, committed 2014-02-25
- Comitter:
- dennyem
- Date:
- Tue Feb 25 23:42:26 2014 +0000
- Parent:
- 2:4184f92440a1
- Commit message:
- Added configureControlReg() to main()
Changed in this revision
PCF8583_rtc.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4184f92440a1 -r 07c00c82338c PCF8583_rtc.lib --- a/PCF8583_rtc.lib Sun Feb 23 21:28:26 2014 +0000 +++ b/PCF8583_rtc.lib Tue Feb 25 23:42:26 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/dennyem/code/PCF8583_rtc/#eaba89d6e5d8 +http://mbed.org/users/dennyem/code/PCF8583_rtc/#3291c1f0b986
diff -r 4184f92440a1 -r 07c00c82338c main.cpp --- a/main.cpp Sun Feb 23 21:28:26 2014 +0000 +++ b/main.cpp Tue Feb 25 23:42:26 2014 +0000 @@ -29,12 +29,13 @@ i2c.frequency(400000); -// dtr = rtc.read(TIME); //Set the clock from scratch -// dtr.time.hours = rtc.bin2bcd(9); -// dtr.time.minutes = rtc.bin2bcd(18); -// rtc.write(TIME, dtr); -// wait(.1); - +/* rtc.configureControlReg(0); + dtr = rtc.read(TIME); //Set the clock from scratch + dtr.time.hours = rtc.bin2bcd(8); + dtr.time.minutes = rtc.bin2bcd(22); + rtc.write(TIME, dtr); + wait(.1); +*/ while(1) { dtr = rtc.read(TIME); i2c.write(ADDR_8574_1, &dtr.time.hours, 1);