Embedded software Assessment 2

Dependencies:   MCP23017 SDFileSystem USBDevice WattBob_TextLCD mbed

Revision:
5:99cf489dcae4
Parent:
4:4bb228d1f6c2
Child:
6:7c31aabc2533
--- a/main.cpp	Sat Feb 15 18:37:26 2014 +0000
+++ b/main.cpp	Sat Feb 15 19:12:16 2014 +0000
@@ -1,12 +1,20 @@
 #include "Function.h"
- 
+
+void flip() {
+    led1 = !led1;
+}
+
 int main(){
     led1=0;
     led2=0;
     led3=0;
     led4=0;
     Init_LCD();
-    TimeA.start();
+        FrequencyIn.rise(&flip);  // attach the address of the flip function to the rising edge
+    while(1) {           // wait around, interrupts will interrupt this!
+        led2 = !led2;
+        wait(0.25);
+    }
     CallFunction1.attach(&job1,1);
     CallFunction2.attach(&job2,0.4);
     CallFunction3.attach(&job3,0.8);