Improve readability and support 4 versions of HexDrive #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Break down update and draw actions into their own functions for each state to improve readability.
When initialising HexDrive EEPROM allow user to select from 4 board types: 4 servo, 2 motor, 2 servo/1motor, unknown which have unique PIDs.
When finding a HexDrive by PID, accept any of the above and set num_servos and num_motors accordingly.
Only offer "Servo Test" if there is a Servo.
Only offer "Motor Moves" if there is a Motor.
Test Servo: UI for the right number of Servos - centred vertially.
Move Motors: Currently no functionality if only 1 motor - so you get a warning. If we can come up with something to do with 1 motor this is place holder to do it.
NB 2 servo/1 motor is probably going to be of use with multiple bords fitted - either to deliver a pair of motors run from HexDrives on different sides of the Badge, or to support 3 motor use cases. (need to support multiple HexDrives being active for this.)
hexdrive.py: add try: around PWM function it was missing for which could fail.