Papke, Kevin
- Welcome
- Period 1 - Advanced Robotics
- Period 3/4 - Design/Robotics
- Period 5 - Exploratory
- Period 6 - Technology
- Expectations
- Catapult contest - History Faire
- Pictures of my classroom
- Robotics Class Video
- Technology links
- Robot-C Programming
- Interesting Stuff
- Ocean Institute
- Fidget spinner
- 15 reasons dogs are better than cats
- Why cats are better than dogs
- Veteran's Day Webquest
- Cinco de Mayo
- PLTW Summit - Onshape Presentation
- Mechanical Power-trains
-
Moving forward a specific distance
This simple program uses “Encoders” to measure the rotation of the axle. This is helpful if you want your robot to go a very precise distance. You will have to measure the circumference of your wheel and divide that by 360 to see how far your robot will go for each degree of rotation. You program your robot to go a specific number of degrees and then you know exactly how far it will go.
task main()
{
//reset right and left encoders to Zero
SensorValue(rightEncoder)=0;
SensorValue(leftEncoder)=0;//while right encoder is less than 1800 (five rotations = 360 * 5 = 1800)
while(SensorValue(rightEncoder) < 1800)
{
startMotor(rightMotor, 63); //right motor goes half speed
startMotor(leftMotor, 63); //left motor goes half speed
}
stopMotor(rightMotor); //right motors stop
stopMotor(leftMotor); //left motor stops
}