While this may not be the final way we want to implement this, we need it for tomorrow if we want to be able to control the pen on any other branch.
Therefore, I'm merging it without review (it can't make the situation worse!) but I'll keep the issue open for any review comments which get made post-merge.
Some questions for the final design:
Do we want the servo power GPIO pin to be cleaned up at the end of the scripts? (The current behaviour). This will mean that the servo will always be disengaged during scripts until its position is set. It's worth noting that all 'public' methods on the plotter set the pen position, so this should be quite easy to achieve (but I may have missed something!!). The set_pen_position.py and set_servo.py scripts can easily be modified to run as mini-interactive environments (for example) to still allow us to test different pen positions and exercise the servo motor.
Alternatively, we can leave the servo power and pwm signal running at the end of scripts. This would require implementing a separate hardware.cleanup function and changing all callers of GPIO.cleanup. It would also mean modifying the gpio_wrapper to record pins set-up through the GPIO.setup calls, so that it can clean up all except for the servo power pin when called by hardware.cleanup.
While this may not be the final way we want to implement this, we need it for tomorrow if we want to be able to control the pen on any other branch. Therefore, I'm merging it without review (it can't make the situation worse!) but I'll keep the issue open for any review comments which get made post-merge.
Some questions for the final design:
plotter
set the pen position, so this should be quite easy to achieve (but I may have missed something!!). Theset_pen_position.py
andset_servo.py
scripts can easily be modified to run as mini-interactive environments (for example) to still allow us to test different pen positions and exercise the servo motor.hardware.cleanup
function and changing all callers ofGPIO.cleanup
. It would also mean modifying thegpio_wrapper
to record pins set-up through theGPIO.setup
calls, so that it can clean up all except for the servo power pin when called byhardware.cleanup
.