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.
Diff: main.cpp
- Revision:
- 0:7681b3a2e015
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Jul 20 10:29:26 2015 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+
+
+DigitalIn a(PTB1);
+DigitalIn b(PTB0);
+DigitalOut c(PTB8);
+DigitalOut myled(LED1);
+
+
+int main()
+{
+ myled=0;
+ int count=0;
+ while(1)
+ {
+ // int count=0;
+ if(a==0)
+ {
+ count++;
+ if(count>=1)
+ {
+ c=1;
+ myled =0;
+ }
+ else
+ {
+ c=0;
+ myled =1;
+ }
+
+ }
+ wait(2);
+
+ if(b==0)
+ {
+ count--;
+ if(count>=1)
+ {
+ c=1;
+ myled =0;
+ }
+ else
+ {
+ c=0;
+ myled =1;
+ }
+ }
+
+ }
+ }
+
+
+
+
+
+