Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.

Slides:



Advertisements
Similar presentations
Teacher/Mentor Institute Using the Cortex Chuck Powell.
Advertisements

US First Robotics Lab View Tutorials Jim Thomas Lawrence Berkeley National Laboratory Team 496 Port Jeff Powerhouse.
LabVIEW is a graphical programming development environment for data acquisition and control, data analysis, and data presentation. With LabVIEW you can.
Vex Robotics Program five: using the radio control transmitter.
BEST Robotic, Inc. easyC Team Training
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Vex Robotics Introduction to Sensors. introduction to sensors Sensors assist robots in seeing and feeling the physical world through which they travel.
Teacher/Mentor Institute Hands-On Session: Building a Robot Scott McEwen & Kevin Barrett July 21-22, 2014.
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.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
© by Pearson Education, Inc. All Rights Reserved.
CS320n –Visual Programming LabVIEW Foundations. Visual ProgrammingLabVIEW Foundations2 What We Will Do Today Hand back and review the midterm Look at.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Vex 1.0 © 2005 Carnegie Mellon Robotics Academy Inc. Programming in easyC.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
By Joshua Shaw.  This presentation demonstrates how to create a program  Take as much time as you need to go through this PowerPoint  Just remember.
ROBOTC for VEX Online Professional Development
MCEN 371 – Mechanical Engineering Lab Chapter 6: LabVIEW Part 1: Introduction.
Introduction to LabVIEW
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Available at: – Operate the Tumbler using a Jumper Pin Operate the Tumbler using the jumper pin.
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
Teacher/Mentor Institute Hands-On Session: Building a Robot Scott McEwen Chuck Powell.
LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
Start Microsoft PowerPoint 1.PowerPoint uses a graphical approach to presentations in the form of slide shows that accompany the oral delivery of the.
Available at: Lesson 3.6 – Program Line Follower in Autonomous Mode Program Line Follower in Autonomous Mode.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
BEST Robotic, Inc. easyC Breakout Session By: Guy Chetrit Programming With easyC September 15, Copyright © 2012 BEST Robotics, Inc. All rights reserved.
Teacher/Mentor Institute Hands-On Session: Building a Robot Carolyn Bauer July 30-31, 2015.
EasyC Programming Workshop January 30, 2008 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
Vex Robotics Programming Sequence. Now that you’ve had some practice downloading and using the included programs, it's time to learn to write some of.
1 Simulink Support for VEX Cortex BEST Robotics 2012 Sandeep Hiremath.
An Introduction to Designing and Executing Workflows with Taverna Aleksandra Pawlik materials by: Katy Wolstencroft University of Manchester.
Chapter Two Creating a First Project in Visual Basic.
Vex Robotics Program six: combining autonomous and radio control.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Created by Blake Ross Start EasyC. Created by Blake Ross.
Teacher/Mentor Institute Using easyC David Dominguez June 2, 2015 Update Version.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Vex Robotics Program four: reversing and turning.
Available at: – Program Functions for VEX Robots Program Functions for VEX Robots.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
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.
Vex Robotics program three: using motors and sensors together.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Teacher/Mentor Institute Intro to easyC Programming Scott McEwen July 21-22, 2016.
By Joshua Shaw.  We have previously added a While Loop  We are now going to use it for programming the robot  We have also added two motor programs.
Teacher/Mentor Institute Hands-On Session: Building a Robot Carolyn Bauer July 21-22, 2016.
Robotics Education & Competition Foundation
After Construction Name: Per #:.
BEST Robotic, Inc. MATLAB/Simulink Team Training
ROBOTC for VEX Online Professional Development
Advanced EasyC Jim Cline July 20-21, 2017.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Basics for Robotics Programming
Programming Autonomy By Joshua Shaw.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Programming a Servo By Joshua Shaw.
Simulink Support for VEX Cortex BEST Robotics Sandeep Hiremath
1.15: Dual Joystick Control (Tank)
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Introduction to Programing the Cortex for BEST
Presentation transcript:

Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015

Outline  Intro to Programming (or Coding)  Intro to easyC  easyC user interface (IDE)  Basic example program  Debugging Tips  Additional TMI easyC Training  Breakout sessions on Friday – Intro and Advance  Charts for Hands-On Session: Building a Robot Intro  Additional charts in TMI Notebook  1 hour easyC Breakout session at Kickoff for Teachers, Mentors and Students Page 2

Programming Overview  Connects inputs to robot outputs  Read Joystick or sensors (inputs)  Determines when and how motors and servos operate (outputs)  Program structure uses decision and logic statements to determine robot responses  Used to fit the requirements of the game and your robot design

Traditional Syntax  Traditional C syntax can be imposing  Program structure is not obvious without experience Page 4

Program Flow  Flow charts can help show structure of a process or a program  More intuitive Page 5

easyC Example Combines both graphical and textual representations of code Combines both graphical and textual representations of code easyC is a simpler version of the C programming language for the VEX Cortex with graphical, drag and drop interface easyC is a simpler version of the C programming language for the VEX Cortex with graphical, drag and drop interface Page 6

easyC User Interface (IDE) Menus Function Blocks Icons Project Explorer Page 7

easyC User Interface - Menus Menu Usage: File Menu: New Project, Open, Close, Print Edit Menu: Undo, Edit, Copy, Paste, Find Project Menu: Project Type, Add Function, Import Function, Library Import Build and Download Menu: Compile, Build and Download, Reload Default IFI Code Tools: Terminal Window, Download Window, On-Line Window Window: Block Layout, Block & C Layout Help Menu: Contents, Registration, Updates Page 8

easyC User Interface - Icons Icons New Project New Competition Project OpenSave Start Page Enable Function Blocks Enable Project Explorer Enable Output Panel Enable Controller Configuration Global Variables Compile Compile and Download Terminal Window Graphic Display On-line Window FindZoom Page 9

easyC User Interface – Function Blocks Program Flow Wait, If, Else, While, Timer, Assignment Inputs Limit Switch, Digital Input, Analog Input, Potentiometer Outputs Motor / Servo Module, Digital Output Joystick Tank (2 Stick), Arcade (Single Stick), Motor to Joystick, Motor to Digital (Button), Get Digital, Get Joystick Mathematics SIN, COS, TAN, Power, Random Page 10

easyC User Interface - Project Explorer Advance Capabilities: Controller Configuration Change Inputs and Output, Label Ports Macros and Constants Create Definitions (aka C #define) Global Variables Variable with Global Program Scope Block Diagram Select Between Functions Source & Header Files Create or Import.c and.h files, Write C- Code Freehand Library Files Import a easyC® library Page 11

Creating a New Program  Select: File…New Competition Project  Select: Field Control Competition Project

 We are going to need a statement that is always true in order for the program to execute more than once  We need to add a While Loop  To do this, go to the Function Blocks box beside your program and click the “+” beside Program Flow Start Programming Page 13

Simple Program Example This simple program can be modified to add additional motors and/or servos This simple program can be modified to add additional motors and/or servos The remaining charts describe the creation of this program The remaining charts describe the creation of this program Page 14

 Then click and drag While Loop from the list and place it on the vertical line between Variables box and End box.  At this point a dialog box appears  Type a true expression such as (2<3) or 1  Click OK While Loop Page 15

While Loop Example This is an example of an inserted While Loop This is an example of an inserted While Loop Without the While Loop, all the statements in the program will only execute once. Your robot will not move when the Cortex is turned on Without the While Loop, all the statements in the program will only execute once. Your robot will not move when the Cortex is turned on Page 16

 Inside the While Loop a set of brackets appear, this is where you add additional statements  First add a motor to the program  Click the “+” beside Joystick under the Function Blocks  Click and drag the Joystick To Motor function to the vertical line between the brackets in your While Loop  When you do this, a dialog box appears which is displayed on the next page Motor Programming (1 of 2) Page 17

 The Joystick to Motor dialog box for Motor Selection:  We can not use Motor 1 in the competition  For this example we will use Motor 2  Click on the down arrow in the motor box and select Motor 2  Motor Numbers 1 and 10 are not permitted for use in competition and are not used in the program Motor Programming (2 of 2) Page 18

 Transmitter is always set to Joystick # 1  Transmitter Channel allows you to select which buttons or joysticks on the Joystick Controller you want to use for a specific purpose  In this program we are going to use the left hand joystick to operate the wheels and the right hand joystick to operate an arm and a claw  We can also change the Channel the same way as we changed the Motor  For this example we will use Channel 1  Which just so happens to be the default  Finally click Ok  You can create as many motor functions as you need for your program. Joystick Transmitter Channel Page 19

 You will use the Channel 1 on the Joystick Controller to operate the motor  Move the Right Joystick left or right to control the Motor Using the Joystick Controller – Channel 1 Page 20

 One of the most commonly used wheel configurations is a wheel on each side of the robot  To avoid spinning in circles, the motors need to spin in opposite directions  The wheels need to spin at the same rate (move the robot straight forward and backward) and spin at different rates (turn the robot)  This can be achieved in an Arcade Function Creating a Program for Wheels Page 21

Arcade Drive Example (page 1 of 2)  This function drives a robot with motors connected to motor numbers 2 (left) and 3 (right), using joystick channels 2 (left stick vertical) and 1 (right stick horizontal)

Arcade Drive Example (page 2 of 2) Motor Numbers Joystick Channels Motor Direction

 To operate the wheels properly the direction of one of the motors needs to reversed (aka inverted)  Invert Direction for Left Motor 6 by clicking the down arrow of Invert Direction and selecting 1  If the robot goes backwards, change Invert Direction of Left Motor 6 to 0 and select 1 under Invert Direction for Right Motor 8  Finally click OK  The motor direction may also be changed by reversing the leads on the motor Arcade Programming - Invert Direction of Motors Page 24

 To operate a servo with the Joystick Controller  Go back to Joystick in the Function Block  Click and drag the Joystick to Servo function to your While Loop and place it on the vertical line between the JoystickToMotor function box and the lower bracket box  When you do this, another dialog box will appear o Except for the Servo title, it looks identical to the Motor Dialog Box  For the example program  Set the Channel to 2 and the Motor to 4 the same way as the Motor was configured  Click OK Servo Programming Page 25

Simple Program Example This simple program demonstrates most of the functionality used to control your Mini-Robot This simple program demonstrates most of the functionality used to control your Mini-Robot Additional training later in the workshop Additional training later in the workshop Kickoff event includes an hour training session for your students. Kickoff event includes an hour training session for your students. Page 26

easyC On-Line Window  The easyC On-Line Window allows the user to see and control motors and sensors attached to the robot in real time. This can be enabled at any time.  Note: The On-Line Window requires a program, even blank, be downloaded after updating the master firmware. Page 27 Debugging Tip: Can be used to identify & correct errors with input and output assignment or wiring

easyC Terminal Window  The easyC allows users to see output from PrintToScreen calls form within their program while the program is running on the Cortex Page 28 Debugging Tip: Printing to screen helps to provide feedback internal state

easyC Terminal Window  The easyC allows users to see output from GraphicDisplay calls form within their program while the program is running on the Microcontroller. The Graphic Display is a more advanced type of feedback that allows values to placed on grid instead of scrolling. See Samples –> “Graphic Display Joystick Test” for code. Page 29 Debugging Tip: Similar to printing but provides a continuous display of internal program variables/inputs/outputs