Supergeniene på bakerste rad / Mbed 2 deprecated Lab02_oppgave1og2

Dependencies:   mbed

Committer:
Voldread
Date:
Thu Oct 08 16:12:24 2015 +0000
Revision:
0:ab7718445b3d
Teller med leds

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Voldread 0:ab7718445b3d 1 #include "mbed.h"
Voldread 0:ab7718445b3d 2
Voldread 0:ab7718445b3d 3 BusOut Leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4);
Voldread 0:ab7718445b3d 4 DigitalIn SW7(PB_3);
Voldread 0:ab7718445b3d 5 DigitalIn SW6(PA_10);
Voldread 0:ab7718445b3d 6
Voldread 0:ab7718445b3d 7 int main()
Voldread 0:ab7718445b3d 8 {
Voldread 0:ab7718445b3d 9 int teller=0;
Voldread 0:ab7718445b3d 10 Leds=~teller;
Voldread 0:ab7718445b3d 11
Voldread 0:ab7718445b3d 12 while (true)
Voldread 0:ab7718445b3d 13 {
Voldread 0:ab7718445b3d 14 if (SW7==0)
Voldread 0:ab7718445b3d 15 { teller=teller+1;
Voldread 0:ab7718445b3d 16 Leds=~teller;
Voldread 0:ab7718445b3d 17 wait_ms(2);
Voldread 0:ab7718445b3d 18 while(SW7==0){wait_ms(1);};
Voldread 0:ab7718445b3d 19 }
Voldread 0:ab7718445b3d 20 if (SW6==0)
Voldread 0:ab7718445b3d 21 { teller=teller-1;
Voldread 0:ab7718445b3d 22 Leds=~teller;
Voldread 0:ab7718445b3d 23 wait_ms(2);
Voldread 0:ab7718445b3d 24 while(SW6==0){wait_ms(1);};
Voldread 0:ab7718445b3d 25
Voldread 0:ab7718445b3d 26 }
Voldread 0:ab7718445b3d 27 }
Voldread 0:ab7718445b3d 28 }