Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming – Remote Control Statements Intro to Robotics.

Similar presentations


Presentation on theme: "Programming – Remote Control Statements Intro to Robotics."— Presentation transcript:

1 Programming – Remote Control Statements Intro to Robotics

2 Radio Control Setup

3

4

5

6

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.

9

10

11

12

13

14 What happens when you start the code?

15

16

17 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.

18 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.

19

20

21

22

23

24

25 Test the robot’s movement using the radio transmitter. TRY THIS! What happens?


Download ppt "Programming – Remote Control Statements Intro to Robotics."

Similar presentations


Ads by Google