KitronikLtd / Kitronik-Pico-Robotics-Board-MicroPython

Example code for the Kitronik Pico Robotics board ( www.kitronik.co.uk/5329 )
MIT License
19 stars 10 forks source link

Adjust prescale value and add motor number sanity checks complete. #4

Closed jamescarr0 closed 2 years ago

jamescarr0 commented 2 years ago

Adjusted the pre-scale value based on the PCA data sheet formula. Added a 500uS delay after setting the SLEEP bit. PWM timings are not guaranteed if the register is accessed within this window. Added motor number sanity checks to ensure only motors 1 - 4 can be passed to the method.