25
Teacher/Mentor Institute Using the Cortex Chuck Powell

Teacher/Mentor Institute Using the Cortex Chuck Powell

Embed Size (px)

Citation preview

Page 1: Teacher/Mentor Institute Using the Cortex Chuck Powell

Teacher/Mentor Institute

Using the Cortex

Chuck Powell

Page 2: Teacher/Mentor Institute Using the Cortex Chuck Powell

Introduction to easyC® & Cortex™

Page 2August 6-7, 2012

Adapted from http://www.intelitekdownloads.com/easyCV4/intro.pdf and http://best.eng.auburn.edu/stored_procedures/folder-manager/create-folder.php?folder=491&parent_id=489

Page 3: Teacher/Mentor Institute Using the Cortex Chuck Powell

Cortex™ Microcontroller

Page 3August 6-7, 2012

Page 4: Teacher/Mentor Institute Using the Cortex Chuck Powell

Cortex™ Joystick

Page 4August 6-7, 2012

Page 5: Teacher/Mentor Institute Using the Cortex Chuck Powell

VEXNet™ USB Keys and Tether

Cable

Page 5August 6-7, 2012

Page 6: Teacher/Mentor Institute Using the Cortex Chuck Powell

easyC® V4 Programming Software

Download from the website.

Run as Administrator to install.

Page 6August 6-7, 2012

Page 7: Teacher/Mentor Institute Using the Cortex Chuck Powell

Unlocking easyC®

Right-click easyC , Run as Administrator

Type in you CD Key and click Unlock.

Page 7August 6-7, 2012

Page 8: Teacher/Mentor Institute Using the Cortex Chuck Powell

Updating easyC®

Page 8August 6-7, 2012

Go to Help…Check For Updates. If you don’t have the latest version, you can download updates.

Page 9: Teacher/Mentor Institute Using the Cortex Chuck Powell

Updating Controller and Joystick

Start…All Programs…easyC v4 For Cortex…IFI VEXNet Firmware Utility

Page 9August 6-7, 2012

Page 10: Teacher/Mentor Institute Using the Cortex Chuck Powell

Updating Controller and Joystick

Select SEARCH. If the response is Upgrade required then BOOTLOAD and YES.

Page 10August 6-7, 2012

Page 11: Teacher/Mentor Institute Using the Cortex Chuck Powell

Updating Controller and Joystick

Click DOWNLOAD. Afterward you should see:

Page 11August 6-7, 2012

Page 12: Teacher/Mentor Institute Using the Cortex Chuck Powell

Updating Controller and Joystick

Now repeat the entire SEARCH…BootLoad…

DOWNLOAD process with the Joystick.

Page 12August 6-7, 2012

Page 13: Teacher/Mentor Institute Using the Cortex Chuck Powell

Tethering Controller and Joystick

After updating the firmware on both the joystick and Cortex: Connect the two devices with the

tethering cable and turn them both on.

Wait until both VEXNet LEDs turn solid green.

This lets the devices learn each other’s addresses, so that they can talk together wirelessly.

Page 13August 6-7, 2012

Page 14: Teacher/Mentor Institute Using the Cortex Chuck Powell

easyC User Interface

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 14August 6-7, 2012

Page 15: Teacher/Mentor Institute Using the Cortex Chuck Powell

easyC User Interface

Icons

New Project

New Competition Project

Open

Save

Start Page Enable

Function Blocks Enable

Project Explorer Enable

Output Panel Enable

Controller Configuration

Global Variables

Page 15August 6-7, 2012

Page 16: Teacher/Mentor Institute Using the Cortex Chuck Powell

easyC User Interface

Icons

Compile

Compile and Download

Terminal Window

Graphic Display

On-line Window

Find

Zoom

Page 16August 6-7, 2012

Page 17: Teacher/Mentor Institute Using the Cortex Chuck Powell

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 17August 6-7, 2012

Page 18: Teacher/Mentor Institute Using the Cortex Chuck Powell

easyC User Interface

Project Explorer

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 18August 6-7, 2012

Page 19: Teacher/Mentor Institute Using the Cortex Chuck Powell

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 19August 6-7, 2012

Page 20: Teacher/Mentor Institute Using the Cortex Chuck Powell

easyC TerminalWindow

The easyC allows users to see output from PrintToScreen calls form within their program while the program is running on the Microcontroller

Page 20August 6-7, 2012

Page 21: Teacher/Mentor Institute Using the Cortex Chuck Powell

easyC TerminalWindow 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.

Page 21August 6-7, 2012

See Samples –> “Graphic Display Joystick Test” for code.

Page 22: Teacher/Mentor Institute Using the Cortex Chuck Powell

Creating a New Program

File…New Competition Project

Field Control Competition Project

Page 22August 6-7, 2012

Page 23: Teacher/Mentor Institute Using the Cortex Chuck Powell

Tank Drive Example

This simple program would drive a robot with motors connected to motor ports 2(left) and 3(right). Using joystick channels 2(right stick) and 3(left stick)

Page 23August 6-7, 2012

Page 24: Teacher/Mentor Institute Using the Cortex Chuck Powell

Arcade Drive Example

This simple program would drive a robot with motors connected to motor ports 2(left) and 3(right). Using joystick channels 2(left stick vertical) and 1(right stick horizontal)

Page 24August 6-7, 2012

Page 25: Teacher/Mentor Institute Using the Cortex Chuck Powell

Next: BEST Control System(BEST Robotics, Inc.)

August 19, 2011

Copyright © 2011 BEST Robotics, Inc. All rights reserved.

25