2017 hongo b alpha

Files at this revision

API Documentation at this revision

Comitter:
Komazawa_sun
Date:
Mon Sep 25 00:14:24 2017 +0000
Parent:
0:3e9f5fcfc775
Commit message:
fix;

Changed in this revision

ShooterAngle.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/ShooterAngle.cpp	Fri Sep 22 04:31:23 2017 +0000
+++ b/ShooterAngle.cpp	Mon Sep 25 00:14:24 2017 +0000
@@ -10,10 +10,13 @@
 
 void ShooterAngle::setAngle(unsigned int angle)
 {
+    uint8_t send_data = 0;
     if(_angle_max < angle)
-        to_slave.write((uint8_t)_angle_max);
-    if(_angle_min > angle)
-        to_slave.write((uint8_t)_angle_min);
+        send_data = (uint8_t)_angle_max;
+    else if(_angle_min > angle)
+        send_data = (uint8_t)_angle_min;
     else
-        to_slave.write((uint8_t)angle);
+        send_data = (uint8_t)angle;
+    printf("%d\r\n",send_data);    
+    to_slave.write(send_data);
 }
\ No newline at end of file