XRP library
The micro-python git is
Not found
The XRP miropython git
Not found
Examples in order from XRP_MicroPython/Examples/drive_examples.py
straight motion:
def drive_straight(drive_time: float = 1): # default parameter with default of 1 second
drivetrain.set_effort(0.8, 0.8) # sets same effort to both wheels to go straight
time.sleep(drive_time)
drivetrain.stop()circular motion:
def arc_turn(turn_time: float = 1):
drivetrain.set_effort(0.5, 0.8) # sets diff effort to both wheels for circular motion
time.sleep(turn_time)
drivetrain.stop()turn:
def swing_turn(turn_time: float = 1):
drivetrain.set_effort(0, 0.8) # sets effort to only wheel so the robot turns in one place
time.sleep(turn_time)
drivetrain.stop()
circle:
square:
polygon
log of data from the ultrasonic sensor
drive till reaching wall
maintain same distance from wall
Last updated