Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DebouncedEdgeIn I2cLCD_cursor Rtc8564 mbed beep
Diff: main.cpp
- Revision:
- 2:6f0158399eff
- Parent:
- 1:f8713c387a68
- Child:
- 3:061cccf4093a
--- a/main.cpp Fri Feb 14 09:24:03 2014 +0000
+++ b/main.cpp Mon Feb 17 08:13:21 2014 +0000
@@ -1,7 +1,5 @@
#include "mbed.h"
#include "I2cLCD/I2cLCD.h"
-#include "EventMechanism/EventHandler.h"
-#include "EventMechanism/EventParam0.h"
#include "I2cRTC/I2cRTC.h"
#include "ViewModel/ClockViewModel.h"
#include "Model/Clock.h"
@@ -11,28 +9,21 @@
int main()
{
- I2C i2c(dp5, dp27); //sda scl
- I2cLCD lcd(i2c, dp4); //i2c reset
- EventMechanism::EventHandler evHandler(512);
- //EventMechanism::EventHandler evHandler(640);
- //EventMechanism::EventHandler evHandler(768);
- I2cRTC rtc(dp1, dp2, i2c, &evHandler);
- ViewModel::ClockViewModel clockVm(lcd, dp13, dp11, &evHandler, myled);
+ I2C i2c(p28, p27); //sda scl
+ I2cLCD lcd(i2c, p26); //i2c reset
+ I2cRTC rtc(p25, p24, i2c);
+ ViewModel::ClockViewModel clockVm(lcd, p21, p22, p23); // set increment decrement
Model::Clock clock(&clockVm, &rtc);
rtc.setClock(&clock);
clockVm.setClock(&clock);
+ clock.initialize();
+ clockVm.initialize();
+ rtc.start();
- //myled = 1;
- evHandler.start();
- //myled = 0;
- evHandler.postEvent(new EventMechanism::EventParam0<Model::Clock>(&clock, &Model::Clock::initialize));
- evHandler.postEvent(new EventMechanism::EventParam0<ViewModel::ClockViewModel>(&clockVm, &ViewModel::ClockViewModel::initialize));
- evHandler.postEvent(new EventMechanism::EventParam0<I2cRTC>(&rtc, &I2cRTC::start));
-
- //uart.puts("ccc\n");
- puts("ccc\n");
while(1) {
- //uart.getc();
- //evHandler.postEvent(new EventMechanism::EventParam0<Model::Clock>(&clock, &Model::Clock::initialize));
+ myled = 1;
+ wait(0.5);
+ myled = 0;
+ wait(0.5);
}
}