send a number through serial USB >> blink it in binary using the default LED

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Files at this revision

API Documentation at this revision

Comitter:
Ladon
Date:
Sat Nov 11 15:16:46 2017 +0000
Parent:
51:38bcf5ee4cb1
Child:
53:2da3dc1461af
Commit message:
sorry, added some more info, change one line of code;

Changed in this revision

README.md 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
--- a/README.md	Sat Nov 11 15:03:45 2017 +0000
+++ b/README.md	Sat Nov 11 15:16:46 2017 +0000
@@ -1,6 +1,11 @@
-In Linux :
+What i did to make it work is :
 
-$ cat > /dev/ttyACM0
+1) open usb in file manager
+2) run in a terminal : 
+    $ stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts -igncr -icrnl -onocr min 1 && cat /dev/ttyACM0
+3) run in another terminal : 
+    $ cat > /dev/ttyACM0
 
-(to quit, hit <Ctrl>+<C>)
-(/dev/ttyACM0 is an example)
\ No newline at end of file
+info :
+    *) to quit, hit <Ctrl>+<C>
+    *) /dev/ttyACM0 is an example
\ No newline at end of file
--- a/main.cpp	Sat Nov 11 15:03:45 2017 +0000
+++ b/main.cpp	Sat Nov 11 15:16:46 2017 +0000
@@ -15,7 +15,7 @@
     while (true) {
         while (!pc.readable());
         pc.scanf("%d", &number);
-//        pc.printf("you entered %d\n", number);
+        pc.printf("you entered %d\n", number);
         blink_in_binary(number);
     }
 }