Download presentation
Presentation is loading. Please wait.
1
Programming – Remote Control Statements
Intro to Robotics
3
Radio Control Setup
7
At this point we have supplied the power value at the time the program is written. But, now that we want the robot to respond to real-time commands from the transmitter, a pre-typed value WILL NOT WORK! Instead, the motor power needs to be set based on a live value set from the transmitter.
8
The joystick’s vertical position is measured by a device called a POTENTIOMOTOR. The signal is translated into a value from 127 to -127, with 0 being the neutral central position.
10
In RobotC, write the following code.
12
What happens when you start the code?
15
The while( ) loop Your robot has the ability to respond to the transmitter input only ONCE. In order to maintain continued control, the motors need to continue being updated with values from the transmitter.
16
while ( ) When the program reaches most commands, it runs them and then moves on. When the program reaches a while ( ) loop, however, it steps INSIDE the loop, and stays there as long as the while ( ) loops decides that it should. The commands repeat over and over.
22
Test the robot’s movement using the radio transmitter. TRY THIS!
What happens?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.