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.
ShooterAngle.cpp
- Committer:
- Komazawa_sun
- Date:
- 2017-09-22
- Revision:
- 0:3e9f5fcfc775
- Child:
- 1:402a36cb88ce
File content as of revision 0:3e9f5fcfc775:
#include "ShooterAngle.h"
ShooterAngle::ShooterAngle(I2C *master, const unsigned int angle_max_, const unsigned int angle_min_):
to_slave(alpha_a::angle, alpha_a::unsig, alpha_a::s3_addr, master),
_angle_max(angle_max_),
_angle_min(angle_min_)
{
}
void ShooterAngle::setAngle(unsigned int angle)
{
if(_angle_max < angle)
to_slave.write((uint8_t)_angle_max);
if(_angle_min > angle)
to_slave.write((uint8_t)_angle_min);
else
to_slave.write((uint8_t)angle);
}