Skip to content

Commit

Permalink
Merge pull request #44 from Open-STEM/ledServoReset
Browse files Browse the repository at this point in the history
Resetbot.py updates
  • Loading branch information
bradamiller authored Jul 29, 2023
2 parents 7fcc979 + 4595c60 commit 9dea3b6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion XRPLib/resetbot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from XRPLib.encoded_motor import EncodedMotor
from XRPLib.imu import IMU
from XRPLib.board import Board
from XRPLib.servo import Servo
"""
A simple file for shutting off all of the motors after a program gets interrupted from the REPL.
Run this file after interrupting a program to stop the robot by running "import XRPLib.resetbot" in the REPL.
Expand All @@ -11,4 +13,12 @@
motor.set_effort(0)
motor.reset_encoder_position()

IMU.get_default_imu().reset()
# Reset IMU registers
IMU.get_default_imu().reset()

# Turn off the on-board LED
Board.get_default_board().led_off()

# Turn off both Servos
Servo.get_default_servo().free()
Servo(17).free()

0 comments on commit 9dea3b6

Please sign in to comment.