Getting Started in RobotC

Slides:



Advertisements
Similar presentations
08/2012Tanya Mishra1 EASYC for VEX Cortex Llano Estacado RoboRaiders FRC Team 1817.
Advertisements

Jason Howard. Agenda I. How to download robotc II. What is tele-op used for? III. How to build a basic tele-op program IV. Getting the robot to drive.
Automation and Robotics
Developed in collaboration with Introduction to Programming.
V EX C OACHES ' T RAINING October 12, Agenda for Today 9 – 10 AM : Tina Reeves and the Engineering Notebook 10 – Noon : Finish Building, Basic Robot.
Autonomy using Encoders Intro to Robotics. Goal Our new task is to navigate a labyrinth. But this time we will NOT use motor commands in conjunction with.
Vex 1.0 © 2005 Carnegie Mellon Robotics Academy Inc. Programming in easyC.
RobotC Programming for LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:
Visual Basic Chapter 1 Mr. Wangler.
 First time student activates their google account, they need to go to an internet browser and go to  drive.google.com/a/students.macon.k12.nc.usdrive.google.com/a/students.macon.k12.nc.us.
 Muscle Shoals Center for Technology Mrs. Stonecipher.
Programming Design ROBOTC Software Principles of Engineering
Robot C and Natural Language
Autonomy using Encoders Intro to Robotics. Autonomy/Encoders Forward for Distance In this unit, you will learn to use the encoders to control the distance.
AUTOMATION WITH ROBOTC Starting to write and troubleshoot computer code.
Find the Mindstorms Icon on the computer.. To start a new program click go.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Getting Started in RobotC // Comment task main() motor[] {} wait1Msec() ; = Header Code Compile Download Run Take out your notes.
Automated Mechanisms Help. Potentiometers Potentiometer Check –Analog Port 2 How they work –Analog sensor –Measures rotation of a shaft between 0 and.
RobotC Remote Control. Learning Objectives: Focusing on Virtual World with Physical Examples Understand Real-Time Joystick Mapping Understand how to use.
Programming - Motion Intro to Robotics. Motors and Sensors Setup The first thing we need to do is tell ROBOTC that we have motors on our robot. Choose.
ROBOTC Software EV3 Robot Workshop
Programming your Robot
Vex Robotics Program Two: Using two motors. Program two: using the motors In the last section, you learned how to turn on one motor. Now, you will take.
Automation and Robotics.  First you select the platform type so that you can use Natural Language PLTW.
Vex Robotics program three: using motors and sensors together.
ROBOTC for VEX Robotics (VEX IQ) On-Line Session 2014 My name is Jason McKenna I will be leading you through these sessions Teacher for 17 years Hopewell.
Testbed Coding In this activity you will code different challenges for the Testbed. For each challenge a sample program is shown. Use what this sample.
Robot C and Natural Language. Create a folder Create a folder on your desktop to insert all your Robot C files, Here you will begin with your template.
Programming Basics - RobotC Introduction to Robotics.
ROBOTC for VEX Online Professional Development Instructor: Jesse Flot
ROBOTC for VEX Online Professional Development By Jesse Flot.
Bot Shop Jane Taylor Dee Wallace Robot C For Vex.
Testbed Coding In this activity you will code different challenges for the Testbed. For each challenge a sample program is shown. Use what this sample.
Programming Design ROBOTC Software. Behavior-Based Programming A behavior is anything your robot does –Turning on a single motor or servo Three main types.
With. Project Overview  Introduction to Factory Automation Numerical Control  Build an autonomous robotic solution  Testing an autonomous robot build.
Robotics Education & Competition Foundation
After Construction Name: Per #:.
Programming Design ROBOTC Software Principles Of Engineering
ClawBot Beginning Programing.
VEX Cortex Video Trainer using ROBOTC
Introduction to Programming
Robotics Programming Using Shaft Encoders
StartStruck in a Virtual World
Getting Started Sec 9-2 Web Design.
StarStruck in a Virtual World: Fantasticbot Version
Programming Design ROBOTC Software Computer Integrated Manufacturing
Programming - Motion Intro to Robotics.
Movement using Shaft Encoders
Autonomy using Encoders
RobotC Sensors.
Getting Started in RobotC
By Willem Scholten Learning Access Institute
Using variables, for..loop and functions to help organize your code
Automation and Robotics
Mr. Smith’s Schedule 1st Period Computer Science I
Mr. Smith’s Schedule 1st Period Computer Science 2
Basketball Drill Programming Alternatives
Programming Basics - RobotC
Programming Design ROBOTC Software Principles Of Engineering
Automation with RobotC
Robotics Programming Using Shaft Encoders
Robotics Programming Using Shaft Encoders
Remote Control For this activity we will use the Squarebot
RobotC Programming for LEGO Mindstorms NXT
Automation with RobotC
Robotics Programming Using Shaft Encoders
Programming Design ROBOTC Software Principles of Engineering
Is there an alternative to copy-paste for repeating code?
Presentation transcript:

Getting Started in RobotC Take out your notes. // Comment task main() motor[] {} wait1Msec() ; = Header Code Compile Download Run Getting Started in RobotC

Learning Objectives Understand the fundamentals of programming a robot. Programmer and Machine Planning and Behavior Basic RobotC Rules Understand how to use the Motors and Sensors Setup to configure your robot. Write a program for a Robot to complete some simple tasks.

Fundamentals Take notes (Ideas, commands, punctuation..) Be prepared to share one thing you learned or was reinforced in the video.

Introduction to Programming Search VEX Cortex Video Trainer or go to the following website. http://education.rec.ri.cmu.edu/products/cortex_video_trainer/ There is also a link on the class website. Click on the ‘Fundamentals’ button Watch and take notes on the videos for 2. Planning and Behaviors 3. RobotC Rules Part 1 4. RobotC Rules Part 2 Be prepared to share one thing from each of the videos. Take the quizzes that are after the videos to check for understanding.

Getting Started in RobotC Open RobotC Select VEX 2.0 Cortex Platform Robot-> Platform ->VEX 2.0 Cortex Make the robot compile to Virtual Worlds Robot-> Compiler Target -> Virtual Worlds Select Virtual World Window->Select Virtual World to Use -> Curriculum Companion Start a new file File – New File

Your Robot

Configuring the Robot: Focus on Motors Robot -> Motors and Sensors Setup Select the motor Currently can only purchase 393 Motors, also modify for internal gearing (high speed, turbo speed) Naming Convention Rules Start with a letter No spaces, punctuation or reserved words (blue) Style Describes what it represents First letter is lowercase otherWordsStartWithUppercaseLetters For these motors leftMotor clawMotor armMotor rightMotor

Motors and Sensors Setup Page 1) Select the ‘Motors’ tab. 3) Use the pull down menus to select the motor. 4) The left motor will need to be reversed so the robot does not go in circles. 2) Name the motor in the desired port. 5) Select the side for drive motors. 7) Click on Apply to remember the changes. 6) Complete the setup for the remaining motors.

Motors and Sensors setup creates ‘pre-processor directives’

Now we can start looking at RobotC motor[motorName] = motorPower; wait1Msec(milliseconds);

What do you think this code will do? {} Vocabulary // Comment task main() motor[] {} wait1Msec() ; = Header Code Compile Download Run The Header // In front of the line makes this line a comment /* */ for multiple line comments. What do you think this code will do? {} Marks the begin and end of a block of code task main() Marks the beginning of the instructions for the Robot. RobotC Is CaSe SeNsItIvE! ; is used to mark the end of a command. motor[rightMotor] = 127; motor[] Used to select the motor. rightMotor = This represents the place where the motor is attached. motor[port10] = 127; does the same thing. = 127; 127 = full power -127 = Reverse 0 = stop Advanced students can also download the program to their physical robot. wait1Msec(2000); The robot continues what it was doing for (2000) milliseconds. Two seconds in this case. Code Break. Open RobotC, configure the motors and enter the above code.

Testing the Program Compile the program Download the program Changes into machine code that the robot understands. Download the program Moving the machine language to your Virtual or Physical Robot Virtual Robot Log in Select Robot Select Challenge Start Activity

Compiling the Program

Oops! The compiler catches syntax (typing) errors and gives some hints on how to fix them.

Any guesses on how to fix these mistakes? Errors Red X = error Yellow X = Warning Errors and hints on the bottom of the page. If you click on an error it will highlight the line of the error. Any guesses on how to fix these mistakes?

Corrected and Compiled

Download the program Since we set it up to map to Virtual Worlds it will download to a Virtual Robot.

Create an Account for you in CS2N Set up and Account with CS2N. It will track progress. Can log in locally as a guest without tracking. Create an Account for you in CS2N

2) I will be using the Clawbot for discussion Select Your Robot 1) Robots Tab 2) I will be using the Clawbot for discussion

Select Activity: Utility-> Imperial Distance Utility 1) Utility Tab 3) Start Activity

Click-Drag: Rotate View Select Camera and Go Follows Right Scroll: Zoom 2) Top Down View Play: Run the program 3) Free Movement: Scroll: Zoom Click-Drag: Rotate View Reset Home Show Sensors Toggle

Your Turn Enter the Sample program Compile and correct errors Motors and Sensors Setup task main() and code Compile and correct errors Download to the virtual robot Run the program http://education.rec.ri.cmu.edu/products/cortex_video_trainer/lesson/index_movement.html Reference Website: http://education.rec.ri.cmu.edu/products/cortex_video_trainer/ Click on Movement for much of the material covered

How the Challenges are Graded Movement: Basketball Drills Programming (10 Points = 100%) ___ Program compiles (4 points) ___ Header complete with names, description and date (2 points) ___ Code is properly indented (2 points) ___ Comments in the program describing the code (2 points) Performance (10 points = 100%) ____ Completed

Save your Solutions in the Movement Challenges Folder. Assignment Complete the following Challenges Basketball Drills Sentry Simulation I Labyrinth Challenge. For each Challenge, demonstrate the solution to Mr. Smith and have your code graded. Save your Solutions in the Movement Challenges Folder.