Test code for blinking LEDs and controlling the FET

Dependencies:   mbed

Fork of mbed_blinky by Mbed

Revision:
8:746b0ef1b899
Parent:
7:11de8dfa1e1d
--- a/main.cpp	Wed May 06 14:48:35 2015 +0000
+++ b/main.cpp	Thu May 07 19:46:37 2015 +0000
@@ -1,33 +1,41 @@
 #include "mbed.h"
 
-DigitalOut myled1(P0_17);
-DigitalOut myled2(P0_19);
-DigitalOut myled3(P0_20);
+DigitalOut bled(P0_17);
+DigitalOut gled(P0_19);
+DigitalOut rled(P0_20);
+DigitalInOut usbout(P0_28);
+//DigitalIn usbout(P0_28);
 
 //***************************************************************************
 //***************************************************************************
 int main(void){
-    //blinkTimer.attach( &blinkLed, 2.0 );
- /*
-    while( true )
-    {
-        sleep();
+
+    bled = 1;
+
+    for(;;){
+        rled = 1; gled = 0; 
+        usbout.output(); usbout=0; 
+        wait(2);
+        rled = 0; gled = 1; 
+        usbout.input(); usbout=1; 
+        wait(2);
     }
-*/
+
+
     for(;;){
-        myled1 = 1; myled2 = 0; myled3 = 0; 
+        rled = 1; bled = 0; gled = 0; 
         wait(0.250);
-        myled1 = 0; myled2 = 1; myled3 = 0;
+        rled = 0; bled = 1; gled = 0;
         wait(0.250);
-        myled1 = 0; myled2 = 0; myled3 = 1;
+        rled = 0; bled = 0; gled = 1;
         wait(0.250);
-        myled1 = 1; myled2 = 1; myled3 = 0;
+        rled = 1; bled = 1; gled = 0;
         wait(0.250);
-        myled1 = 1; myled2 = 0; myled3 = 1;
+        rled = 1; bled = 0; gled = 1;
         wait(0.250);
-        myled1 = 0; myled2 = 1; myled3 = 0;
+        rled = 0; bled = 1; gled = 0;
         wait(0.250);
-        myled1 = 1; myled2 = 1; myled3 = 1;
+        rled = 1; bled = 1; gled = 1;
         wait(0.250);
     }
 }