Skip to content

Commit

Permalink
DM: tweak servo duty cycle so it doesn't overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
deanm1278 committed May 22, 2018
1 parent e68805a commit c2d4211
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions seesaw_servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ uint8_t seesaw_Servo::attach(int pin)
uint8_t seesaw_Servo::attach(int pin, int min, int max)
{
attach(pin);
this->min = min*3.27;
this->max = max*3.27;
this->min = min*3.2767;
this->max = max*3.2767;

return 0;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ int seesaw_Servo::read()
/**************************************************************************/
void seesaw_Servo::writeMicroseconds(int value)
{
uint16_t val = 3.2768 * value;
uint16_t val = 3.2767 * value;
_ss->analogWrite(_pin, val);
_sval = val;
}

0 comments on commit c2d4211

Please sign in to comment.