rter

Dependencies:   BluetoothSerial SeeedShieldBot mbed

Files at this revision

API Documentation at this revision

Comitter:
simwiu
Date:
Thu Nov 12 09:06:01 2015 +0000
Commit message:
er

Changed in this revision

BluetoothSerial.lib Show annotated file Show diff for this revision Revisions of this file
SeeedShieldBot.lib Show annotated file Show diff for this revision Revisions of this file
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/BluetoothSerial.lib	Thu Nov 12 09:06:01 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/yihui/code/BluetoothSerial/#f56002898ee8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SeeedShieldBot.lib	Thu Nov 12 09:06:01 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/components/code/SeeedShieldBot/#9fd1722259a1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 12 09:06:01 2015 +0000
@@ -0,0 +1,52 @@
+#include "mbed.h"
+
+BusOut Leds (PA_9,PC_7,PB_6,PA_5,PB_5,PB_4);
+InterruptIn SW7 (PB_3);
+InterruptIn SW4 (PC_1);
+
+static int teller=0;
+
+void SW7_Pushed()
+{ teller=teller+1;
+  //Leds=~teller;
+}
+
+int main()
+{
+    //Leds=~teller;
+    SW7.fall(&SW7_Pushed);
+    wait_ms(5);
+    
+    while (true)
+    {
+        SW4==1;
+        
+        teller=0;
+        SW7.enable_irq();
+        wait_ms(1000);
+        SW7.disable_irq();
+        
+        if (teller >= 8)
+            Leds=~0xFF;
+        else if (teller >= 7)
+            Leds=~0x7F;
+        else if (teller >= 6)
+            Leds=~0x3F;
+        else if (teller >= 5)
+            Leds=~0x1F;
+        else if (teller >= 4)
+            Leds=~0x0F;
+        else if (teller >= 3)
+            Leds=~0x07;
+        else if (teller >= 2)
+            Leds=~0x03;
+        else if (teller >= 1)
+            Leds=~0x01;
+        else Leds=~0x00;
+            
+        
+        
+    }
+}     
+          
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 12 09:06:01 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad
\ No newline at end of file