Clock with Real-Time Clock (RTC-8564) and I2C LCD module(SB1062B).

Dependencies:   DebouncedEdgeIn I2cLCD_cursor Rtc8564 mbed beep

/media/uploads/togayan/imgp0004s.jpg /media/uploads/togayan/lcdclock_circuit_rev4.png

Committer:
togayan
Date:
Sun Feb 23 00:16:54 2014 +0000
Revision:
4:75ed86b78045
Parent:
3:061cccf4093a
Child:
5:e374481e7554
1st release.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
togayan 0:86ab67787717 1 #include "mbed.h"
togayan 0:86ab67787717 2 #include "I2cLCD/I2cLCD.h"
togayan 4:75ed86b78045 3 #include "Rtc8564/Rtc8564.h"
togayan 0:86ab67787717 4 #include "ViewModel/ClockViewModel.h"
togayan 4:75ed86b78045 5 #include "Mechanism/RtcMechanism.h"
togayan 1:f8713c387a68 6 #include "Model/Clock.h"
togayan 1:f8713c387a68 7
togayan 0:86ab67787717 8 int main()
togayan 0:86ab67787717 9 {
togayan 3:061cccf4093a 10 I2C i2c(dp5, dp27); //sda scl
togayan 3:061cccf4093a 11 I2cLCD lcd(i2c, dp26); //i2c reset
togayan 4:75ed86b78045 12 Rtc8564 rtc(i2c, dp25, PullUp);
togayan 3:061cccf4093a 13 ViewModel::ClockViewModel clockVm(lcd, dp1, dp2, dp4); // set increment decrement
togayan 4:75ed86b78045 14 RtcMechanism rtcMechanism;
togayan 4:75ed86b78045 15 Model::Clock clock(&clockVm, &rtcMechanism);
togayan 4:75ed86b78045 16 clock.addSetMode(&rtcMechanism);
togayan 3:061cccf4093a 17 clock.addSetMode(&clockVm);
togayan 4:75ed86b78045 18 rtcMechanism.setClock(&clock);
togayan 4:75ed86b78045 19 rtcMechanism.setRtc(&rtc);
togayan 1:f8713c387a68 20 clockVm.setClock(&clock);
togayan 2:6f0158399eff 21 clock.initialize();
togayan 2:6f0158399eff 22 clockVm.initialize();
togayan 4:75ed86b78045 23 rtc.initialize();
togayan 0:86ab67787717 24
togayan 4:75ed86b78045 25 while(1);
togayan 0:86ab67787717 26 }