Skriv antall blink

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Voldread
Date:
Thu Oct 08 16:14:30 2015 +0000
Commit message:
Skriv antall blink

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 08 16:14:30 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad
\ No newline at end of file