adafruit / Adafruit_Seesaw

Arduino library driver for seesaw multi-use chip
93 stars 64 forks source link

Fixed typo preventing motor powers below 100% #16

Closed codydg closed 5 years ago

codydg commented 5 years ago

fabs inputs and outputs doubles (as opposed to abs which uses integers, and fabsf which uses floats). abs(value) takes all values below 100% power and rounds them down to 0% power.

ladyada commented 5 years ago

just to check, what board/platform is this you're using?

ladyada commented 5 years ago

just verified on a circuit Playground express setting throttle to 0.5 does the right thing

codydg commented 5 years ago

I have the Feather HUZZAH w/ ESP8266 on a Crickit, and I'm compiling using PlatformIO in Visual Studio Code.

I've attached an example file which, when I run it, only drives the motor when throttle is +- 1.0, but if I change abs to fabs, it works as intended.

main.zip

ladyada commented 5 years ago

ahh this is probably an espressif thing

ladyada commented 5 years ago

thanks!