BioAmp-EXG-Pill icon indicating copy to clipboard operation
BioAmp-EXG-Pill copied to clipboard

ClawController prone to out or range or invalid servo values

Open kevinjwalters opened this issue 6 months ago • 0 comments

The ClawController aims to drive the servo between 90 and 180 degrees but

  • the code only uses map and does not use constrain to guarantee the values are within that range
  • the code has overflow issues with 16bit arithmetic (Arduino Uno int is 16bit) on a large buffer of ADC values

Another improvement is to use float for the envelop function/variable to avoid the coarse conversion for integer based Arduino map.

kevinjwalters avatar Jan 03 '24 13:01 kevinjwalters