Clock with Real-Time Clock (RTC-8564) and I2C LCD module(SB1062B).
Dependencies: DebouncedEdgeIn I2cLCD_cursor Rtc8564 mbed beep
main.cpp@0:86ab67787717, 2014-02-09 (annotated)
- Committer:
- togayan
- Date:
- Sun Feb 09 09:05:25 2014 +0000
- Revision:
- 0:86ab67787717
- Child:
- 1:f8713c387a68
Working to change to the clock
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
togayan | 0:86ab67787717 | 1 | #include "mbed.h" |
togayan | 0:86ab67787717 | 2 | #include "I2cLCD/I2cLCD.h" |
togayan | 0:86ab67787717 | 3 | #include "EventMechanism/EventHandler.h" |
togayan | 0:86ab67787717 | 4 | #include "I2cRTC/I2cRTC.h" |
togayan | 0:86ab67787717 | 5 | #include "ViewModel/ClockViewModel.h" |
togayan | 0:86ab67787717 | 6 | |
togayan | 0:86ab67787717 | 7 | int main() |
togayan | 0:86ab67787717 | 8 | { |
togayan | 0:86ab67787717 | 9 | InterruptIn clockIn(dp1); |
togayan | 0:86ab67787717 | 10 | I2C i2c(dp5, dp27); //sda scl |
togayan | 0:86ab67787717 | 11 | I2cLCD lcd(i2c, dp4); //i2c reset |
togayan | 0:86ab67787717 | 12 | EventMechanism::EventHandler evHandler; |
togayan | 0:86ab67787717 | 13 | ViewModel::ClockViewModel clockVM(lcd); |
togayan | 0:86ab67787717 | 14 | I2cRTC rtc(clockIn, dp2, i2c, &evHandler, &clockVM); |
togayan | 0:86ab67787717 | 15 | |
togayan | 0:86ab67787717 | 16 | clockVM.initialize(); |
togayan | 0:86ab67787717 | 17 | evHandler.start(); |
togayan | 0:86ab67787717 | 18 | wait(0.25); |
togayan | 0:86ab67787717 | 19 | rtc.start(); |
togayan | 0:86ab67787717 | 20 | |
togayan | 0:86ab67787717 | 21 | while(1); |
togayan | 0:86ab67787717 | 22 | } |