Download presentation
Presentation is loading. Please wait.
1
ROBOTC for VEX On-Site Professional Development
2
Advanced Remote Control
3
Advanced Remote Control
More loop control please? Is remote controlling the robot forever always appropriate? Next Challenge: Mine Removal Challenge 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!
4
Timers
5
Advanced Remote Control
Wasting Time? The time it takes to turn on the VEX and get situated could be used to score points, but is wasted. 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 Program Flow Trace Could this idea also be used to make a “more friendly” start button on a non-radio controlled robot? Other ideas of how to improve remote control? Use the buttons to initiate common actions Turn 90 degrees, move straight forward, ect
6
Advanced Remote Control
Use the buttons to control the arm The VEXnet Remote Control buttons send values of 0 or 1
7
Sensing
8
Sensor Information: Touch Sensors
9
Touch Sensors Touch Sensor Check How they work Setting them up
Limit Switch plugged into Digital Port 6 Bumper Switch plugged into Digital Port 11 How they work Digital sensor - Pressed or Released Watch out for “bouncing” Setting them up ROBOTC Motors and Sensors Setup window Using them The SensorValue[] command
10
Move Forward until Pressed
11
Touch Sensors Start Button
Remember how we used the Remote Control button to start the timer portion of the program. How would we implement the same thing with the bumper switch?
12
Sensor Information: Potentiometer
13
Potentiometers Potentiometer Check How they work Setting them up
Plugged into Analog Port 3 How they work Analog sensor Measures absolute rotation of a shaft between 0 and ~265 degrees Returns values 0 – ~4095 Internal mechanical stops Setting them up ROBOTC Motors and Sensors Setup window Using Analog and Digital Sensors Using them The SensorValue[] command
14
Potentiometers
15
Advanced Arm Control
16
Sensor Information Ultrasonic Rangefinder
17
The Ultrasonic Rangefinder
Ultrasonic Rangefinder Check Input wire plugged into Digital Port 8 Output wire plugged into Digital Port 9 How they work Similar to how bats and submarines work Digital sensor – but returns distance values in inches, centimeters, or millimeters on the Cortex Setting them up ROBOTC Motors and Sensors Setup window Using them Be careful not to use them immediately as your program starts – they take time to initialize and will return negative values The SensorValue[] command
18
Ultrasonic Rangefinder
Other Properties The Ultrasonic Rangefinder is able to detect objects in a “cone” field of view. As objects get further away, the sensor is able to detect them further away from the center of the sensor. The sensor bases distance calculations off of sound waves, which means that some objects may not be detectable: soft objects that absorb sound, sharp objects that deflect sound, etc. Do not use the ultrasonic sensor as the very first command in your code. Until the first sound echo returns to the sensor, it will have a value of -1. A simple delay at the beginning of your program solves this.
19
Forward until Near
20
The Ultrasonic Rangefinder
Forward until Near Move forward until the robot is “near” an object, then stop Automatic Pick-up Straight Forward until Near + picking up the mine Optional: Assign to a button on the Remote Control
21
The Ultrasonic Rangefinder
Forward/Straight until Near Move straight forward until the robot is near an object, then stop Follow along with videos in VCVT Automatic Pick-up Straight Forward until Near + picking up the mine Optional: Assign to a button on the Remote Control
22
VEX Robotics Competition Programming
23
VEX Robotics Competitions
Official VEX Competitions utilize special Field Control Hardware to enable and disable robots
24
Competition Templates
ROBOTC is fully legal in VEX Competitions You must program using the built-in templates Competition Template Driver Skills Template
25
Competition Template Pre-autonomous code goes here – clear encoders, ect Autonomous code goes here Remote Control code goes here
26
Testing Competition Code
The ROBOTC Competition Control Debug Window simulates the Field Control Hardware, so you can test your code
27
Additional Sensors
28
Sensor Activities Finish the Automatic Pickup Behavior
Add code to automatically score the ball Quick-Tap Challenge Review Sensing Videos With a Virtual Robot: Sensing > Robocci Sensing > Speed of Sound Sensing > Robo-Dunk 2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.