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:5ac066a676fa
- Child:
- 1:3fc3afc28bda
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Nov 01 09:47:15 2019 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+
+DigitalOut myled_1(p8);
+DigitalOut myled_2(p11);
+Serial pc(USBTX,USBRX);
+
+int main()
+{
+ while(1) {
+ if(pc.readable()) {
+ char sel=pc.getc();
+ if(sel=='i') {
+ myled_1=1;
+ myled_2=1;
+ printf("(1,1) \r\n");
+ }
+ if(sel=='m') {
+ myled_1=0;
+ myled_2=0;
+ printf("(0,0) \r\n");
+ }
+ if(sel=='j') {
+ myled_1=1;
+ myled_2=0;
+ printf("(1,0) \r\n");
+ }
+ if(sel=='k') {
+ myled_1=0;
+ myled_2=1;
+ printf("(0,1) \r\n");
+ }
+ }
+ }
+}