Nurbol Nurdaulet / Mbed 2 deprecated 2sensors_2servo

Files at this revision

API Documentation at this revision

Comitter:
Nurbol
Date:
Mon Nov 14 15:13:57 2011 +0000
Parent:
0:2b10383306a2
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Nov 10 11:47:25 2011 +0000
+++ b/main.cpp	Mon Nov 14 15:13:57 2011 +0000
@@ -121,7 +121,13 @@
                 command->result_status = CMD_BAD_SERVO_VALUE;
                 break;
             }
-            pulse_width = 1000 + (command->param[1] * 1000) / MAX_SERVO_ANGLE;  // convert angle to pulse width
+            if ((command->param[0] == 4) && (command->param[1] == 0)) {
+                 pulse_width = 0;  // convert angle to pulse width
+                 }
+            else{ 
+                pulse_width = 1000 + (command->param[1] * 1000) / MAX_SERVO_ANGLE;  // convert angle to pulse width   
+            }
+            
     //
     // implement servo move to all 5 servos
     //
@@ -141,7 +147,8 @@
 //
         case READ_CMD :
             command->nos_data = 1;                   // no data to be returned
-            command->result_data[0] = last_servo;
+            command->result_data[0] = valueLED1;
+            command->result_data[1] = valueLED2;
             break;
 //
 // catch any problems