Embedded software Assessment 2

Dependencies:   MCP23017 SDFileSystem USBDevice WattBob_TextLCD mbed

Committer:
muaiyd
Date:
Sat Feb 15 19:12:16 2014 +0000
Revision:
5:99cf489dcae4
Parent:
4:4bb228d1f6c2
Child:
6:7c31aabc2533
interrupt test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
muaiyd 0:86bba6bf9b6f 1 #include "Function.h"
muaiyd 5:99cf489dcae4 2
muaiyd 5:99cf489dcae4 3 void flip() {
muaiyd 5:99cf489dcae4 4 led1 = !led1;
muaiyd 5:99cf489dcae4 5 }
muaiyd 5:99cf489dcae4 6
muaiyd 0:86bba6bf9b6f 7 int main(){
muaiyd 4:4bb228d1f6c2 8 led1=0;
muaiyd 4:4bb228d1f6c2 9 led2=0;
muaiyd 4:4bb228d1f6c2 10 led3=0;
muaiyd 4:4bb228d1f6c2 11 led4=0;
muaiyd 0:86bba6bf9b6f 12 Init_LCD();
muaiyd 5:99cf489dcae4 13 FrequencyIn.rise(&flip); // attach the address of the flip function to the rising edge
muaiyd 5:99cf489dcae4 14 while(1) { // wait around, interrupts will interrupt this!
muaiyd 5:99cf489dcae4 15 led2 = !led2;
muaiyd 5:99cf489dcae4 16 wait(0.25);
muaiyd 5:99cf489dcae4 17 }
muaiyd 4:4bb228d1f6c2 18 CallFunction1.attach(&job1,1);
muaiyd 4:4bb228d1f6c2 19 CallFunction2.attach(&job2,0.4);
muaiyd 4:4bb228d1f6c2 20 CallFunction3.attach(&job3,0.8);
muaiyd 4:4bb228d1f6c2 21 CallFunction4.attach(&job4,2);
muaiyd 4:4bb228d1f6c2 22 CallFunction5.attach(&job5,1.8);
muaiyd 4:4bb228d1f6c2 23 CallFunction6.attach(&job6,1.5);
muaiyd 4:4bb228d1f6c2 24 CallFunction7.attach(&job7,5);
muaiyd 4:4bb228d1f6c2 25
muaiyd 0:86bba6bf9b6f 26 }