4tronix / PiconZero

Initial commit
13 stars 11 forks source link

Documentation for motor values in misleading #9

Open robberwick opened 6 years ago

robberwick commented 6 years ago

This comment regarding valid motor values is misleading: https://github.com/4tronix/PiconZero/blob/ffdc9d63b6f8f2905f89c8144edc065037c83b9e/Python/piconzero.py#L44

The actual usable range of motor values is -100 to 100, according to the source for setMotor in PiconZero08.ino -

// Byte received is unsigned, so anything over 128 is actually negative. Convert to signed int first
// Value 0 = OFF (Low-Low)
// Value 100+ = Forward (High, Low) no PWM
// Value -100 = Backward (Low, High) no PWM
// Value 1..99 = Forward (High, Low) with PWM value == value
// Value -1 .. -99 = Reverse (Low, High) with PWM value == -command)
// PWM is applied to the first motor pin for Forward and the second motor pin for Reverse