s

Dependencies:   mbed

Fork of LAB07_Oppgave2 by EL-POM1001

Committer:
Voldread
Date:
Thu Oct 15 15:02:32 2015 +0000
Revision:
3:a6daf1c79697
Parent:
2:a27126b6128e
s

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rlanghbv 0:78adfca8ca69 1 #include "mbed.h"
rlanghbv 0:78adfca8ca69 2
rlanghbv 1:2e42c8846b90 3 InterruptIn knapp(PB_3);
rlanghbv 1:2e42c8846b90 4 BusOut leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
rlanghbv 1:2e42c8846b90 5 static int teller=0;
rlanghbv 2:a27126b6128e 6 Timeout timeOutIrq;
rlanghbv 1:2e42c8846b90 7
rlanghbv 2:a27126b6128e 8 void enableKnappeTrykk(){
rlanghbv 2:a27126b6128e 9 knapp.enable_irq();
rlanghbv 2:a27126b6128e 10 }
rlanghbv 0:78adfca8ca69 11
rlanghbv 1:2e42c8846b90 12 void knappTrykket(){
Voldread 3:a6daf1c79697 13 //knapp.disable_irq();
Voldread 3:a6daf1c79697 14 //timeOutIrq.attach(&enableKnappeTrykk,.1);
rlanghbv 1:2e42c8846b90 15 teller=teller+1;
rlanghbv 1:2e42c8846b90 16 leds=~teller;
rlanghbv 0:78adfca8ca69 17 }
rlanghbv 0:78adfca8ca69 18
rlanghbv 1:2e42c8846b90 19 int main(){
rlanghbv 1:2e42c8846b90 20 knapp.fall(&knappTrykket);
rlanghbv 1:2e42c8846b90 21 leds=~0;
rlanghbv 1:2e42c8846b90 22 while (true) { wait(1); }
rlanghbv 0:78adfca8ca69 23 }