LAB02_Oppgave1og2
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 BusOut Leds(PA_9,PC_7,PB_6,PA_7,PA_6,PA_5,PB_5,PB_4); 00004 DigitalIn SW7(PB_3); 00005 DigitalIn SW6(PA_10); 00006 00007 00008 int main() 00009 { 00010 int teller=0; 00011 Leds=~teller; 00012 00013 while (true) 00014 { 00015 if(SW7==0) 00016 { teller=teller+1; 00017 Leds=~teller; 00018 wait_ms(2); 00019 while(SW7==0){wait_ms(1);}; 00020 } 00021 if (SW6==0) 00022 { teller=teller-1; 00023 Leds=~teller; 00024 wait_ms(2); 00025 while(SW6==0){wait_ms(1);}; 00026 } 00027 } 00028 00029 }
Generated on Sun Jul 31 2022 05:47:21 by
1.7.2