Designed to help you get your Raspberry Pi based Robot. This board can control DC motor as well as the stepper motor. You can connect your IR and Ultrasonic sensors to tell your robot about its environment. You can easily make your Line Following, Object following, Wall following, Maze-Solver Robots.
Please see commit from Oct 21, 2019. I added a function to return current motor speed, and an array of motor speeds for linked motors.
This allows developers to capture the current speed programmatically for use in calculations. This makes using, say an analog stick on a controller easier to work with.
Usage:
Single motor getSpeed() returns integer speed value.
Linked motor getSpeed() returns array of integer speed values.
Example:
motor1 = PiMotor.Motor("MOTOR1")
motor2 = PiMotor.Motor("MOTOR2")
motors = PiMotor.LinkedMotors(motor1, motor2)
motor1.forward(100)
print(motor1.getSpeed()) #prints speed for motor 1 (100)
motors.forward(50)
print(motors.getSpeed()) #prints array of motor speeds ([50, 50])
There's also some changes where I commented out the print(). Please ignore that. I was trying to reduce output so I could work on a bug in another script.
Please see commit from Oct 21, 2019. I added a function to return current motor speed, and an array of motor speeds for linked motors.
This allows developers to capture the current speed programmatically for use in calculations. This makes using, say an analog stick on a controller easier to work with.
Usage: Single motor
getSpeed()
returns integer speed value. Linked motorgetSpeed()
returns array of integer speed values.Example:
There's also some changes where I commented out the
print()
. Please ignore that. I was trying to reduce output so I could work on a bug in another script.