this is a drive library for the maker pi rp2040 by cytron.
because there's nothing worse than not knowing how to use your python library
to use this library, you need to do the following:
- download
drive.py
- In thonny, enable "show hidden files"
- open the file in thonny
- go to File > Save As
- select "raspberry pi pico" or "RP2040"
- save the file to the "lib" directory as "drive.py"
this is a quick and simple test program:
import drive
drive.forward(2)
your robot should drive forward when you run this program
so far, this library includes the following commands:
init()
stop()
forward()
backward()
leftslow()
leftfast()
rightslow()
leftslow()
For the commands leftslow()
, leftfast()
, rightslow()
, and rightfast()
, you have speed and duration as the parameters. use them like this: leftslow(speed, duration)
For forward()
and backward()
, you only have speed
And for init()
and stop()
, you have none.