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
Diff: main.cpp
- Revision:
- 0:38c4995b3635
diff -r 000000000000 -r 38c4995b3635 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Dec 18 21:18:40 2018 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+Serial pc(D1,D0); // Configure LED1 pin as output
+DigitalIn button1(D2);
+DigitalIn button2(D3); // Configure P1_14 pin as input
+
+int main()
+{
+ while(1) {
+ if(button1 == 1){pc.printf("1HIGH\n");}
+ if(button2 == 0){pc.printf("1LOW\n");}
+ if(button2 == 1){pc.printf("2HIGH\n");}
+ if(button2 == 0){pc.printf("2LOW\n");} /* read the state of input pin P1_14 and write it to output port pin LED1*/
+ }
+}
\ No newline at end of file