Skriv antall blink
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:ab2d2270407a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 08 16:14:30 2015 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" + +//define LEDS +BusOut leds(D8,D9,D10,D11,D12,D13,D4,D5); +//define Buttons +BusIn buttons (A0,A1,A2,A3,A4,A5,D2,D3); + +int main() +{ + int antallBlink=0; + int e=0; + + while(1) + { + printf("Skriv inn hvor mange ganger lysiodene skal blinke: \r\n"); + scanf("%d",&antallBlink); + + leds=~antallBlink; + for (e=0; e<antallBlink; e++) // + { + leds=0xFF; + wait_ms(500); + leds=0x00; + wait_ms(500); + } + + } +} \ No newline at end of file