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:
Mon Feb 17 08:13:21 2014 +0000
Revision:
2:6f0158399eff
Parent:
1:f8713c387a68
Child:
3:061cccf4093a
test

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 0:86ab67787717 3 #include "I2cRTC/I2cRTC.h"
togayan 0:86ab67787717 4 #include "ViewModel/ClockViewModel.h"
togayan 1:f8713c387a68 5 #include "Model/Clock.h"
togayan 1:f8713c387a68 6
togayan 1:f8713c387a68 7 //Serial uart(dp16, dp15);
togayan 1:f8713c387a68 8 DigitalOut myled(LED1);
togayan 0:86ab67787717 9
togayan 0:86ab67787717 10 int main()
togayan 0:86ab67787717 11 {
togayan 2:6f0158399eff 12 I2C i2c(p28, p27); //sda scl
togayan 2:6f0158399eff 13 I2cLCD lcd(i2c, p26); //i2c reset
togayan 2:6f0158399eff 14 I2cRTC rtc(p25, p24, i2c);
togayan 2:6f0158399eff 15 ViewModel::ClockViewModel clockVm(lcd, p21, p22, p23); // set increment decrement
togayan 1:f8713c387a68 16 Model::Clock clock(&clockVm, &rtc);
togayan 1:f8713c387a68 17 rtc.setClock(&clock);
togayan 1:f8713c387a68 18 clockVm.setClock(&clock);
togayan 2:6f0158399eff 19 clock.initialize();
togayan 2:6f0158399eff 20 clockVm.initialize();
togayan 2:6f0158399eff 21 rtc.start();
togayan 0:86ab67787717 22
togayan 1:f8713c387a68 23 while(1) {
togayan 2:6f0158399eff 24 myled = 1;
togayan 2:6f0158399eff 25 wait(0.5);
togayan 2:6f0158399eff 26 myled = 0;
togayan 2:6f0158399eff 27 wait(0.5);
togayan 1:f8713c387a68 28 }
togayan 0:86ab67787717 29 }