Eivind Dammen
/
LAB07_Oppgave2
oppg2
Fork of LAB07_Oppgave2 by
main.cpp
- Committer:
- eivindd24
- Date:
- 2016-12-10
- Revision:
- 3:676daabf1a54
- Parent:
- 2:a27126b6128e
File content as of revision 3:676daabf1a54:
#include "mbed.h" InterruptIn knapp(PB_3); BusOut leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4); static int teller=0; Timeout timeOutIrq; void enableKnappeTrykk(){ knapp.enable_irq(); } void knappTrykket(){ knapp.disable_irq(); timeOutIrq.attach(&enableKnappeTrykk,.3); teller=teller+1; leds=~teller; } int main(){ knapp.fall(&knappTrykket); leds=~0; while (true) { wait(1); } }