Presentation is loading. Please wait.

Presentation is loading. Please wait.

Timothy Friez Carnegie Mellon/Robomatter January 27th, 2015

Similar presentations


Presentation on theme: "Timothy Friez Carnegie Mellon/Robomatter January 27th, 2015"— Presentation transcript:

1 Timothy Friez Carnegie Mellon/Robomatter January 27th, 2015
ROBOTC Technical Talk Timothy Friez Carnegie Mellon/Robomatter January 27th, 2015

2 ROBOTC Overview A complete ‘C’ programming language for robotics.
Developed for Teaching, Powerful enough for Hobbyists/Professionals Developed in Microsoft Visual C and IAR Embedded Workbench I’ll answer the question now: NO MAC SUPPORT Works great under Bootcamp, Parallels or VM Ware Fusion. MAC support is desired, but hasn’t made a business/development case yet. Extremely easy to use for both beginners and advanced users Most “robot functions” are a single line commands.

3 ROBOTC Language Single Programming Language / Multiple Platforms
Mindstorms – NXT and EV3 Innovation FIRST – VEX Cortex, and VEX IQ Arduino - Arduino Uno, Mega, Mega 2560 controllers Developed for Education (High School/College) Students learn in a friendly environment about C-Based programming Friendlier Compiler, GUI Device Configuration, Code Templates Focus is for new programmers to C, but powerful to make experienced programmers feel comfortable.

4 ROBOTC as a Language Language extensions for robotics
Built-in variables for robotics devices – motors, sensors, joysticks Example: One line command to drive motors NXT - motor[motorA] = 100; //Turn Motor 100% User “friendly” compiler Auto-correct from popular programming errors Letter case errors in variable names: “playSound” for “PlaySound”. Compiler is NOT CASE Sensitive – This is by design!

5 Development Environment
Normal-style source code editor Syntax highlighting and formatting Code completion Integrated help/support Compiler, linker and program downloader – integrated and combined No command line tools required (or available…) Interactive Run-Time Debugger Allows monitoring of tasks (threads), variables, devices such as motors and sensors. User friendly “Basic”, “Expert” and “Super User” mode to adjust features and menus 100+ programming examples in the “Sample Code” Library

6 Interactive Real-time Run-Time Debugger
Run/Stop, Suspend/Resume programs from PC Single step through program execution, one line at a time. Unlimited user defined breakpoints Read / write / display the contents of any user variable. Consciously view the status of all devices in at run-time from your PC. Zero additional coding required, enabled by default!

7 ROBOTC vs. “Other” Languages
#1 Reminder: You are creating code to be run of a 256kb ARM Processor – not a desktop! Variables and Memory The NXT Supports… Integers, Longs, Floats, Bytes, Bool, Chars and Strings (String are limited to 20 characters – use Char[] for longer strings) The NXT has room for 15,000 bytes of variables Adding “const” in front of a variable will make that variable a constant. This will prevent the variable from being changed by the program Constants do not take up any memory on the NXT Support for Pointers/Recursion (standard ANSI C-style) ROBOTC is a procedural language – there are no classes. You can use a “struct” as an alternative to group variables.

8 Functions and Tasks You can create functions (up to 255)
Standard C programming style for declaration void functionName(int parameters, float otherParameters) Utilize library (.h) files to organize your code You can create “tasks” too – Up to 20 tasks per program. task myTask() – Create a Task (no parameters) startTask(myTask) – Starts the Task stopTask(myTask) – Ends the Task Key thing to remember: Single processor, single thread at a time. The internal task manager will run other tasks when idle time is available Create idle time in a task by using the “wait1Msec(time)” command Main structure in ROBOTC is “task main()”, not “void main()”

9 ROBOTC vs. “Other” Languages
Libraries and Workspaces ROBOTC is built around a 1-program model – no workspace files. ROBOTC automatically includes all of the headers behind the scenes Stuff like math libraries, string support, standard language libraries are already included. You can create your own external libraries and do a “#include” to bring them into your program. Advanced C Data Structures Pointer Support (* and &) void testFunct(int &tempVar) Structs and Typedefs are supported Standard ANSI-C support in most cases.

10 ROBOTC vs. “Other” Languages
LCD Capabilities You have full control of the LCD – Take a look at the help documentation / samples. You can turn individual pixels on or off, or use some of the drawing libraries already built into ROBOTC. Advanced Ideas with NXT I2C Support – Big 3rd party sensor library or roll your own File I/O See Sample Programs – You can write to text files and use the NXT File Management utility to download the file to your PC Bit Shifting and Comparators operators are available Arrays – ROBOTC supports up to 2-dimention arrays.

11 Support and Curriculum
ROBOTC.net Community Forums Over active users Most questions can be answered here ROBOTC Technical Support – Ticketing System Or Tim or John directly Help Documentation / Function Reference Built-In and Online at Video based curriculum Answers questions about how to use hardware and gives beginning programming tutorials

12 ROBOTC Licensing You’re entitled to a free copy of ROBOTC thanks to this class Download from Use the following licensing information: ROBOTC for MINDSTORMS 4.X License ID: Password: Howie2015 You may need the LEGO USB Driver as well This is typically included in the installer package and automatically installed. 32Bit: 64Bit:

13 ROBOTC Live Demo Loading Firmware Opening a Sample Downloading Code
Running Code Using the Debugger


Download ppt "Timothy Friez Carnegie Mellon/Robomatter January 27th, 2015"

Similar presentations


Ads by Google