template for serial protocol

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Hotboards
Date:
Wed Jun 22 18:19:35 2016 +0000
Parent:
0:ed82bc2dec29
Commit message:
second release

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ed82bc2dec29 -r 0fec28dd7cd1 main.cpp
--- a/main.cpp	Wed Jun 22 16:50:14 2016 +0000
+++ b/main.cpp	Wed Jun 22 18:19:35 2016 +0000
@@ -65,8 +65,18 @@
             
             case 3:  //slider
             {
-
+ 
+                int d1,d2,d3,val;
                 
+                d1 = rxbuff[3]-48;
+                d2 = rxbuff[4]-48;
+                d3 = rxbuff[5]-48;
+                
+                val = (d1*100)+(d2*10)+d3;
+                
+                
+                
+                pc.printf("%d\r\n",val);
             }
             break;