Test program to measure current of mbed

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tosihisa
Date:
Fri Jul 30 01:39:53 2010 +0000
Commit message:

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
diff -r 000000000000 -r 41b606c44f60 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 30 01:39:53 2010 +0000
@@ -0,0 +1,49 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+int main() {
+    unsigned char count = 0;
+    while(1) {
+        switch(count){
+            case 0:
+                led1 = 0;
+                led2 = 0;
+                led3 = 0;
+                led4 = 0;
+                break;
+            case 1:
+                led1 = 1;
+                led2 = 0;
+                led3 = 0;
+                led4 = 0;
+                break;
+            case 2:
+                led1 = 1;
+                led2 = 1;
+                led3 = 0;
+                led4 = 0;
+                break;
+            case 3:
+                led1 = 1;
+                led2 = 1;
+                led3 = 1;
+                led4 = 0;
+                break;
+            case 4:
+                led1 = 1;
+                led2 = 1;
+                led3 = 1;
+                led4 = 1;
+                break;
+        }
+        count++;
+        wait(5.0);
+        if(count > 4){
+            count = 0;
+        }
+    }
+}
diff -r 000000000000 -r 41b606c44f60 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 30 01:39:53 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da