Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of mbed_blinky by
Revision 8:746b0ef1b899, committed 2015-05-07
- Comitter:
- aarongymtrack
- Date:
- Thu May 07 19:46:37 2015 +0000
- Parent:
- 7:11de8dfa1e1d
- Commit message:
- Hey Mordechai!
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file | 
--- 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);
     }
 }
    