Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:402a36cb88ce, committed 2017-09-25
- 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