Presentation is loading. Please wait.

Presentation is loading. Please wait.

ROBOTC for VEX Online Professional Development

Similar presentations


Presentation on theme: "ROBOTC for VEX Online Professional Development"— Presentation transcript:

1 ROBOTC for VEX Online Professional Development

2 Homework Questions Thoughts? Questions?

3 Warm-up Questions How do the Shaft Encoders work?
Compare and contrast the while loop with the if statement. What is Boolean logic?

4 Troubleshooting Student: One of my encoders is counting down even though the wheels are spinning forward.

5 Troubleshooting Student: My robot won’t stop turning.

6 Remote Control

7 VEXnet Joysticks An out-of-box VEX Cortex comes with basic built-in Remote Control functionality The VEXnet Joysticks do not have settings like the older Radio Control Transmitters ROBOTC enables full customization of how the VEXnet Joystick signals controls the Cortex If the Cortex and VEXnet Joystick are linked over VEXnet, there is no extra code to enable remote control – they’re already linked!

8 VEXnet Joysticks The VEXnet Joysticks and Cortex (when linked) continually send data back and forth Two Joysticks with two “Channels” each Values range from -127 to 127 12 Buttons A Pressed button = 1, released = 0 Built in Accelerometer X and Y values No crystal or chance of interference, Cortex and VEXnet Joysticks create their own wireless network over VEXnet

9 Wireless Programming and Debugging
The connection between the VEXnet Joysticks and Cortex can be used to wirelessly download the ROBOTC Firmware, ROBOTC Programs, and debugger data! Even when you’re not actively “using” the VEXnet Joysticks, it’s transmitting and the batteries are draining. Batteries last ~2 hours; use it wisely!

10 VEXnet Configuration Switch your VEX Cortex Download Method to Download using VEXnet or USB Remember that you will need to download a program and power-cycle the Cortex for the setting to take effect.

11 VEXnet Configuration 2. Connect the VEXnet Joysticks to the computer and update its firmware

12 VEXnet Configuration 3. Establish a VEXnet Link between the Cortex and Remote Control

13 VEXnet Configuration 4. Insert VEXnet Keys and Test!

14 Remote Control Reset The VEXnet Joysticks should be recalibrated before use The VEXnet Remote Control may not have its joystick values calibrated correctly, since it’s last firmware download The Cortex and VEXnet Joysticks must be synched before the joystick values can be calibrated

15 vexRT[] Command The vexRT[] Command allows you to access any of the values from the VEXnet Joysticks The values from the joystick axis are identified by the the letters “Ch” + the number closest to them Channel variable names: Ch1 - X-Axis - Right Joystick Ch2 - Y-Axis - Right Joystick Ch3 - Y-Axis - Left Joystick Ch4 - X-Axis - Left Joystick

16 vexRT[] Command The buttons are identified by the letters “Btn” + the number closest to it + the letter etched into it Button variable names: Btn5U - Button group 5 - "U" (up) Btn5D - Button group 5 - "D" (down) Btn6U - Button group 6 - "U" (up) Btn6D - Button group 6 - "D" (down) Btn7U - Button group 7 - "U" (up) Btn7D - Button group 7 - "D" (down) Btn7L - Button group 7 - "L" (left) Btn7R - Button group 7 - "R" (right) Btn8U - Button group 8 - "U" (up) Btn8D - Button group 8 - "D" (down) Btn8L - Button group 8 - "L" (left) Btn8R - Button group 8 - "R" (right)

17 Joystick Value Mapping
Direct Value Mapping Values from the remote control are directly used to control the motors (1:1 ratio)

18 Joystick Value Mapping
Indirect Value Mapping Values from the remote control are modified before being used to control motors Can make the robot easier to control Appropriate in situations that require more “delicate” movements Notice: the robot reads the right side of the equal sign first

19 ROBOT Motion Commands that cause the entire robot to perform a behavior arcadeControl() tankControl()

20 Tank Control One Joystick/Channel controls the right side of the robot; another joystick/channel controls the other side of the robot

21 Arcade Control One Joystick/Channel controls the forward/backward movement of the robot; another joystick/channel controls the turning of the robot

22 Remote Control Follow along with the Remote Control > Joystick Mapping Videos for Review

23 Remote Control Exercise 1
Part 1: Write a program that uses the left joystick to control the power level of the left motor, and the right joystick to control the power level of the right motor. The program should run forever. Part 2: Modify your program so that 1/3 of the left and right joystick values are applied to the motors.

24 Advanced Remote Control
More loop control please? Is remote controlling the robot forever always appropriate? Question: Where would the wait statement go if we wanted the robot to be remote controlled for a controlled amount of time? Answer: Nowhere! We need something else. Solution: Timers Can be thought of as internal stopwatches (4 available) Like encoders, timers should be “cleared” anytime before they are used Watch where you clear them!

25 Timers Standard ROBOTC: Natural Language:

26 Timers Follow along with the Remote Control > Timers Videos for Review

27 Button Control Wasting Time? Wait for a Remote Control Button press
The time it takes to turn on the VEX Cortex and start using the Joysticks is wasted time. Could we make the robot wait to start it’s timer until we were ready? Any ideas? Wait for a Remote Control Button press The robot won’t start the timer until we say so The robot also can’t move until we says so Could this idea also be used to make a “more friendly” start button on a non- remote controlled robot? Other ideas of how to improve remote control? Use the buttons to initiate common actions Turn 90 degrees, move straight forward, ect

28 Button Control Attach the Arm! Use the buttons to control the arm
The VEXnet Joystick buttons send values of 0 or 1

29 Button Control Standard ROBOTC Version

30 Button Control Natural Language Version

31 Buttons Follow along with the Remote Control > Buttons Videos for Review

32 Homework VCVT Videos Challenges: Remember to Pseudocode
Watch remaining Remote Control Videos Challenges: RoboDunk (Autonomous version) Round-Up Turn Buttons Investigation Remember to Pseudocode Day 3 Practice Quiz Remember to shut off your robot and remote control when they’re not in use!


Download ppt "ROBOTC for VEX Online Professional Development"

Similar presentations


Ads by Google