BioAmp-EXG-Pill
BioAmp-EXG-Pill copied to clipboard
ClawController prone to out or range or invalid servo values
The ClawController aims to drive the servo between 90 and 180 degrees but
- the code only uses
map
and does not useconstrain
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
.