Ohnishi_Gundan / Mbed 2 deprecated Master-FM

Dependencies:   MODSERIAL mbed-rtos mbed

Fork of Master by Ohnishi_Gundan

Revision:
9:6057314dc8ec
Parent:
8:bfcfda6b38fe
Child:
10:a90935ea0a4b
--- a/bluetooth.cpp	Sat Sep 13 09:42:55 2014 +0000
+++ b/bluetooth.cpp	Sat Sep 13 11:03:52 2014 +0000
@@ -85,7 +85,7 @@
         //PACK:     [option/function/pwm*4]
         //pwm
         for( int i=0 ; i<4 ; i++ ){
-            temp.byte[i]=buf[1+i];
+            temp.byte[i]=buf[2+i];
         }
         motor( buf[1], temp.fl );
     }
@@ -192,4 +192,12 @@
     
     pc.printf( "%f %f\n", *_ir, *_fsr );
         
+}
+
+void sendMotor( char function, float power ){
+    char f[1];
+    float p[1];
+    f[0] = function;
+    p[0] = power;
+    sync( SYNC_MOTOR, f, p );
 }
\ No newline at end of file