robot c for vex on site professional development n.
Skip this Video
Loading SlideShow in 5 Seconds..
ROBOT C for VEX On-Site Professional Development PowerPoint Presentation
Download Presentation
ROBOT C for VEX On-Site Professional Development

ROBOT C for VEX On-Site Professional Development

158 Views Download Presentation
Download Presentation

ROBOT C for VEX On-Site Professional Development

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. ROBOTC for VEXOn-Site Professional Development

  2. Lab Procedures • Logging onto computers • Log in with: teachers / teachers1 • VEX Robots/chargers • Make sure during breaks, lunches and end of day to charge your robot • Headsets • Each workstation has two headsets to allow both partners to watch the videos at the same time • Teacher folders and journals

  3. ROBOTC this Week • There are several versions of ROBOTC on your desktops • This class we will use ROBOTC 3.0 Beta as much as possible

  4. Discussion • What is a robot? • What can you teach with a robot? • Journaling

  5. VEX 0.5 PICSystem Overview

  6. VEX 0.5 PIC Testbed • Features: • VEX PIC • 2 Motors • Servo Motor • Ultrasonic Rangefinder • Potentiometer • Ambient Light Sensor • Line Tracking Sensor • Limit Switch • Bumper Switch • RF Receiver • LED

  7. VEX 0.5 PIC Overview • Coordinates the flow of information and power on the robot • All electronic components interface with the microcontroller • 8 Motor Ports • 16 Analog/Digital Ports for Sensors • Rx1 and Rx2 Ports for Radio Control

  8. ROBOTC Overview

  9. Background Information • ROBOTC is developed specifically with teachers, classrooms, and competitions in mind • Complete programming solution for the VEX PIC, VEX Cortex, and several other popular robot platforms • Approved for VEX Robotics, BEST, TSA and RoboFest Competitions! • Only programming language for the VEX PIC and VEX Cortex with a real-time debugger • You’ll learn more about this feature later on • Very similar to industry-standard C programming • Students get real-world programming experience

  10. Industry Standard Coding Students that learn ROBOTC Programming are also learning key components of Industry Standard Programming Languages...

  11. Industry Standard IDE Students programming in the ROBOTC IDE are also learning how to use features in Industry Standard IDE’s...

  12. Visual Studio IDE and Code

  13. ROBOTC IDE and Code

  14. ROBOTC Features

  15. Platform Type Allows you to toggle ROBOTC’s programming mode between the VEX PIC and VEX Cortex, will enable features and commands for the system

  16. ROBOTC Start Page Displays the latest ROBOTC news, version of ROBOTC, and ROBOTC Resources

  17. Sample Programs Over 75 Included ROBOTC Sample programs, organized by robot behavior

  18. Comments • Comments are used to make notes in code for the human programmers • Every sample program contains comments pertaining to robot configuration, ROBOTC commands, robot behavior, etc • // Single line comment – everything after “//” is ignored by the ROBOTC compiler • /* Multi-line comment*/ - everything between the “/*” and “*/” symbols is ignored by the ROBOTC compiler

  19. ROBOTC Help In-depth explanations about the ROBOTC interface, commands, debugger, etc

  20. Function Library Lists the available functions, with a description. List of available functions will expand or shrink depending on the “Menu Level”

  21. Menu Level Customizes the ROBOTC interface and Function Library based on the user’s experience level

  22. Motors and Sensor Setup • One central place to configure and name all of the motors and sensors attached to your Cortex

  23. Teaching ROBOTC for IFI VEX Robots

  24. Teaching ROBOTC for IFI VEX Robots (TRC4V) • 40 tutorial videos • 275 pages of printable guides aligned to the videos • 50 pages of supplementary “helper guides” • 35 programming challenges • Freely available at

  25. Student-Paced Instruction • Everyone learns different things at different paces • Everyone MUST move at a different pace • Going too fast results in failure and frustration • Going too slow results in loss of attention (i.e. future failure) • TRC4V can be used as a teaching aid • One instructor can’t teach at 20 different paces simultaneously • One instructor plus 20 computers can

  26. System Configuration

  27. Downloading Firmware • What is Firmware? • Step 1: Download Master Firmware • Step 2: Download ROBOTC Firmware • Step 3: Power-cycle the VEX

  28. ROBOTC “Natural Language”

  29. ROBOTC Natural Language • Goal is to lower the barrier of entry into syntax-based programming by simplifying the code and using more “natural” command names • Lines of code for common robot behaviors are consolidated into single commands • forward(); • lineTrackforTime(); • stop(); • untilBump();

  30. ROBOTC Natural Language • The Natural Language is an additional Platform Type in ROBOTC:

  31. ROBOT Motion • Commands that cause the entire robot to perform a behavior

  32. Setup • Allows you to specify what type of robot configuration you have from pre-specified models (RECBOT, Swervebot)

  33. Movement • Commands that allow you to control individual motors / servos

  34. Special • Commands that control the more unique VEX Hardware – LED’s and Flashlights

  35. Until • Commands that allow you to create behaviors where the robot acts “until” a certain event • Button Press • Encoder Count Reached

  36. Wait • Commands that wait for an elapsed amount of time in seconds or milliseconds

  37. Sample Programs

  38. Moving Forward and Backward

  39. Basic Programming:Motor and Wait Commands

  40. VEX Motors • 3 Main Types: • Original 3-wire motor • Newer 2-wire motor 269 • Newer 2-wire motor 393 • All motors are programmedthe same way in ROBOTC • Accept values between 127 (full forward) and -127 (full reverse)

  41. Motor 2 for 5 Seconds Displays configuration changes from the Motors and Sensors Setup Defines the “main task” of the robot All commands belonging to task main must be in-between these curly braces

  42. Motor 2 for 5 Seconds Turns the port2 rightMotor on at half power forward

  43. Motor 2 for 5 Seconds Causes the robot to wait here in the program for 5.0 seconds

  44. Motor 2 for 5 Seconds Stops the port2 rightMotor. End Result: rightMotor spins for 5.0 seconds.

  45. Quick ROBOTC Exercise • Create this program yourself and download it to the Robot • Using the Program Debug Window

  46. Renaming and Reversing • Robot > Motors and Sensors Setup • Optional with Motors (not Sensors) • Giving Motors custom names • Reversing motor polarity

  47. Naming Rules • The Motors and Sensor Setup window allows you to give your motors and sensors custom names. The names, however: • Should be descriptive of the sensor or motor they refer to (rightMotor, frontBumper, ect.) • Must be all one word made up of letters, numbers, and underscores • Must contain no special characters (&, $, /, ect.) • Cannot already be a ROBOTC reserved word (task, motor, true)

  48. Quick ROBOTC Exercise • Make Changes to the Program • Turn on leftMotor • Download and watch result • Reverse both motors • Download and watch result

  49. Motor Exercises • Turn the rightMotor on forward at full speed for 6 seconds, then stop. • Turn the leftMotor on in reverse at three-fourths speed for 2.5 seconds, then stop. • Turn both motors on at half power for 3 seconds, stop for two seconds, reverse at half power for 3 seconds, then stop.