Presentation is loading. Please wait.

Presentation is loading. Please wait.

ROBOTC for VEX Online Professional Development By Jesse Flot.

Similar presentations


Presentation on theme: "ROBOTC for VEX Online Professional Development By Jesse Flot."— Presentation transcript:

1 ROBOTC for VEX Online Professional Development By Jesse Flot

2 Welcome Tech Check Tools VEX Hardware Basic Movement Program Planning ROBOTC Natural Language

3 Tech Check

4 Voice communication –Introduce yourself –Checkmark yourself Screen sharing –DEMO: Starting ROBOTC –LAB: Show your ROBOTC

5 What can you teach with a robot? Type your thoughts in the space below

6 Tools

7 CS2NLearn - The Learning Management System (LMS) –Logging in, and where to post homework Three Main Pieces of Software –1. WebEX –2. ROBOTC Application –3. ROBOTC Curriculum / Tutorial Videos

8 Tools The Forums –Class Forum for announcements and asking questions can be found under the Announcements and Information section: –http://www.robotc.net/forums/ Active ROBOTC Community

9 Hardware Overview

10 VEX 2.0 Cortex Overview Coordinates the flow of information and power on the robot All electronic components interface with the Cortex 10x Faster than the PIC 10 Motor Ports 8 Analog Ports 12 Digital VEXnet Wireless I2C and UART Ports

11 RECBOT 2 Driving Motors 1 Arm Motor 2 Quadrature Encoders 1 Potentiometer 1 Touch Sensor 1 Ultrasonic Rangefinder 1 Gyroscope

12 Squarebot and Swervebot These robot models will work, too, with some small adaptations:

13 ROBOTC Overview

14 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

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

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

17 Visual Studio IDE and Code

18 ROBOTC IDE and Code

19 ROBOTC Features

20 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

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

22 Sample Programs Over 100 Included ROBOTC Sample programs, organized by robot behavior

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

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

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

26 VEX Cortex Communication Mode Allows you to specify: 1.How programs are downloaded 2.Whether the Cortex looks for a VEXnet connection when it starts up With “VEXnet or USB” the Cortex will look for a VEXnet connection before running code

27 VEX Cortex Video Trainer using ROBOTC

28

29 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) VCVT can be used as a teaching aid –One instructor can’t teach at 20 different paces simultaneously –One instructor plus 20 computers can

30 VEX Cortex Video Trainer (VCVT) 60 tutorial videos teach step-by-step how to program using ROBOTC and the Cortex 100+ pages of supplementary “helper guides” 40+ programming challenges Freely available at www.robotc.net

31 Activity: Download Firmware Step 1: Choose Appropriate Platform Type Step 2: Update Master and ROBOTC Firmware

32 ROBOTC Programming

33 Motor Port 3 Forward Defines the “main task” of the robot All commands belonging to task main must be in-between these curly braces

34 Motor Port 3 Forward Turns the port3 motor on at full power forward

35 Motor Port 3 Forward Robot stays here in the program for 3000 milliseconds End Result: robot spins one motor for 3 seconds

36 Get Your Motors Running Motor Check –Right Motor is plugged into MOTORS 2 –Left Motor is plugged into MOTORS 3 Download Sample Program –File > Open Sample Program > Training Samples > Motor Port 3 Forward Run the Sample Program –What does it do? –How could we make the robot move forward?

37 Renaming and Reversing Robot > Motors and Sensors Setup –Optional with Motors –Giving Motors custom names –Reversing motor polarity

38 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)

39 Basic Movements Forward / Reverse

40 Basic Movements Point Turns

41 Basic Movements Swing Turns

42 Basic Movements Manual Adjustments

43 ROBOTC “Natural Language”

44 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();

45 ROBOTC Natural Language The Natural Language is an additional Platform Type in ROBOTC:

46 ROBOT Motion Commands that cause the entire robot to perform a behavior

47 Wait Commands that wait for an elapsed amount of time in seconds or milliseconds

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

49 Sample Programs

50 Moving Forward and Backward

51 Quick ROBOTC Exercise Use the Natural Language commands to create a program that: 1.Turns on leftMotor and rightMotor at ¾ speed for 5 seconds Download and watch result 2.Reverse both motors at ¼ speed for 5 seconds Download and watch result

52 Program Planning

53 Behavior Based Programming A behavior is anything your robot does: –turning on a single motor, moving forward, tracking a line, navigating a maze Three main types of behaviors: –basic behaviors – single commands to the robot (turn on a motor) –simple behaviors – simple task performed by the robot (move forward, track a line) –and complex behaviors – robot performs a complex task (solve the maze) Complex behaviors can always be broken down into simple behaviors, which are then broken down into basic behaviors

54 The Labyrinth Challenge

55

56 Programming Discussion The Challenge: The Labyrinth The Solution: ??? The Programmer’s (your) Role –Understanding Program Flow and Behavior Based Programming –Plan out the robot’s path / actions - Pseudocoding –Translate the Pseudocode into real code The Robot’s role –To carry out your instructions! The Solution: Programmer and Robot working together, fulfilling their roles –True for all robotic challenges!

57 Pseudocode Pseudocode is a shorthand notation for programming which uses –informal programming structures (if touch1 is pressed…) –verbal descriptions of code (move forward, stop) Emphasis is placed on expressing the behavior or outcome of each portion of code rather than on correct syntax (it should be reasonable, though). Your lines of Pseudocode should also be listed in the same order as they will appear in the ROBOTC Program

58 Pseudocode Sample Pseudocode:

59 Pseudocode Additional Details: –Pseudocode is used to outline a program before translating it into proper syntax. –Helps in the initial planning of a program, by creating the logical framework and sequence of the code. –An additional benefit is that it can be translated into different programming languages and is therefore somewhat universal.

60 Putting it all Together Effective Program Planning is essential to writing correct code. Carrying out that plan is equally important! Once you have your plan, don’t try to implement it all at once! Systematically add sections of code, testing at every step!

61 ROBOTC Rules/Syntax Syntax is the cause of 80% of programming errors… Most important thing to do when troubleshooting: Check Syntax –Missing Semicolons –Incorrect Braces on Structures –Misspelled words –Improper ‘case’ – motor vs. MoToR ROBOTC is friendly about most of these errors... but can’t catch everything.

62 Labyrinth Challenge Begin programming for the Labyrinth Challenge! Use Standard ROBOTC or the Natural Language Remember to Pseudocode the Behaviors first!

63 Homework! Homework assignments can always be found and turned-in on CS2NLearn You’ll also be expected to watch a series of videos for review Optional practice quizzes will prepare you for the certification exam at the end


Download ppt "ROBOTC for VEX Online Professional Development By Jesse Flot."

Similar presentations


Ads by Google