Storming Robots Tutorial and Learning Materials

Packets for Storming Robots Students


Common Creative licence Clause Unless otherwise noted, Storming Robots retains with copyrights under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0; pursuant from the day this document was published by Storming Robots. You may copy, distribute and transmit the work IF AND ONLY IF appropriate credit is provided, and changes were made only under Storming Robots' permission.See the Legal Code under the Creative Commons
- by Elizabeth Mabrey -
- Technical Paper Template- - Engineering Journal Guide-

Computer Science and Engineering

Note: This was written mainly for SR's Algorithms in C/C++ students for reference, not meant to be a detailed tutorial. Go here to see detailed syllabus for this track.

Computer Science - Computational Programming

- last update - Dec/2016

Other more advanced topics in Data Structure, such as stack/queue and many other algorithms will be covered in Level III+ in the Algorithms in C/C++ track.

Using Eclipse as the IDE for C/C++

Command Line Build: Build your files without using the IDE..

AP Computer Science (OOPS-Java).   Exercises.

A video clip showing how to create a Java project in Eclipse IDE

Programming Style and Troubleshooting (with hardware) Guide (coming soon!)

Links from other websites which I found very useful:

The C Library Reference Guide -- a reference on the C language and its standard library.

comp.lang.c FAQ- covering many of C's complicated corners and idiosyncrasies

Coming soon : Sorting and Searching + USACO Exercises.


RobotC  /  Robotics

NOTE:   RobotC IDE, by the CMU Robotics Academy, comes with a rich set of samples. You should be able to consult its sample directories at ease.  Use the New Help feature from version 4.X.  Be resourceful!

This tutorial is written to complement the guidance of robotics projects conducted in our Robotics Engineering Program. This is designed mainly for Storming Robots students to perform further review and exercises at home. Therefore, the format does not present itself an ideal self-taught material. However,  those students who have taken Algorithms in C/C++ with us will find the tutorial very intuitive to follow.

For Graphical RobotC

Graphical RobotC Packet (last updated - Nov/2016)

Should work on the samples and challenges listed in the packet on the left.

Additional Challenge

For VexIQ/RobotC

RobotC for VexIQ Packet (updated - August/2015)

For Mindstorms/ RobotC

RobotC Packet I (last updated - December/2016)
The following files are all in zip format. Some of these samples contain error files which you are supposed to correct.

A reference table to use RobotC 's pragma

Note: Found errors - please Email us .

NXT and EV3 RGB Color Sensor Samples (for  EV3 and NXT). - <updated in October, 2017)

EV3 Motor Synchronization Sample - <updated in July, 2018)

A Simple Programming Style Best Practice for robotic project students.

RobotC Packet II (last updated - Dec/2014)

The following files are all in zip format.

  • some of these samples contain error files which you are supposed to correct.

Download Chapter 1 Samples   Download Chapter 2 Samples

Download Chapter 3 Samples   Download Chapter 4 Samples

Download Chapter 5 Samples   Download Chapter 6 Samples (w/ Data Logging)

 Applied Gear Math

You should not pass this point until you are complete with the Packet I and II above.   The following samples were written with the assumption that you have already had satisfactory skill level from the Packet I & II. Some of them were written for students who have already taken algorithm in C with us (past the pointer chapter).

The following samples may have been written with older RobotC version. Therefore, do not expect they all compile perfectly. However, if you have worked through Packet I and II, you should not have difficulty in making necessary modification to make them  work.

RobotC -Interface with I2C devices

Learning I2C with RobotC

RobotC - I2C Interface Packet I (last updated - July/2014)

Document covers :

  • Binary vs. Hexadecimal vs Decimal conversion
  • Bit-wise Math Operations
  • Bit-shift Operations
  •  RobotC  Native I2C APIs
  • HiTechnic Accelerometer/Tilt Sensor specifics
  • HiTechnic IR Seeker Sensor specifics
  • HiTechnic Sensors MUX Device specifics

Sample I2C device code (using I2C Samples and common libraries files):

Accelerometer Sample Library
(contains the two main sample functions to interface with Accelerometer)

Accelerometer Sample Test (must download the Sample Library as well)


Find Light Array samples from RobotC's installation  - from "File > Open Sample programsNXT > 3rd Party Sensor Drivers" - look for Mindsensors  array samples.

Here is a sample calibration program using HiTechnic Light Array

Notes:  Finishing up to Packet II from above will help to understand samples from RobotC with ease.  In addition, you may find files won't compile due to small changes in more latest versions of RobotC.  However, if you have thorough understanding in Packet II, you should have no issue in fixing these errors.

Whenever you use a new sensor, you should always understand its behavior by performing data logging.    Consult Chapter 6 in Packet II.

Special Note:

Mindsensors created a I2C adapter module which allows :
- connect NXT with EV3 sensors
- connect EV3 with multiple sensors on its' port splitter.

Here is a video to show you how to scan it using the I2C scanner tool.
Test Your I2C sensors on a Mindsensor Splitters

I2C interface - Packet II

This packet gears toward cross-platform communication with NXT as the master controller and Arduino as the I2C slave controller. This will allow NXT to interface with non-NXT digital and analog sensors and devices.

Sample Codes - NXT as the master device, and Nano as the slave device

Learning how to work with Compass (RobotC)

Compass Sensor Interface Packet (last updated - Jan/2013) Exercises
  • csSimple.c: Simple operation on compass sensor data.
  • csGoDir.c :  your controller only terminates when it faces west no matter which direction it faces at the startup time.
  • csReturn.c: your controller only terminates when it returns back to the direction where it faces at the startup time.
  • You must calibrate first. Read the packet on the left.

After playing with the samples, you should make the modification yourselves:
  • csGoDir.c :  add in motor navigation code to make your robot turn to west no matter which direction it faces at the startup time.
  • csReturn.c:  add in motor navigation code to make your robot turn back to the direction where it faces at the startup time.

I2C RobotC-Arduino

I2C RobotC-Arduino Packet

Use this packet if you want to :
-  interface Mindstorms NXT with Arduino via I2C.
-  create your own Arduino based combo sensors device, ie. using  Arduino as  I2C slave device. 

Wireless Communication with Mindstorms via Bluetooth

Bluetooth Interface (last updated - June/2014)


  • Should have two controllers (NXT bricks), one for the hand held controller (the master), another one is the robot car (the worker).
  • Have manually established the bluetooth connection from the master brick to the worker brick. Exercises
  • btSender.c : send one byte counter to the receiver via bluetooth
  • btReceiver.c : receive the one byte counter from the sender via bluetooth
  • btSearchNConnect.c : master device performs search and connect when the device is not connected.

After playing with this communication, you should make modification to perform the following:
  • btSender.c : make this a hand-held controller unit. Incorporate the buttons control as the control switches which will dictation how the receiver bot navigate. e.g.:
    • left button == move left
    • right button == move right
    • enter button == backup, etc.
  • btReceiver.c : make this a moving engine.  After receiving the one byte counter from the sender via bluetooth, it should decode the byte and navigate accordingly.

Wireless Communication with Mindstorms via XBee

A Quick Start Intro doc.

GPS Data Streaming

GPS Data Streaming    TBD.

Check out the Multi-agent site  and RobotC/CMU 's firework site.

IR Seeker

To use the  HiTechnic specific driver library codes,  you need to:

- access the drivers from the RobotC IDE:
  • click on "File" --> "Open Sample Program"
  • click on "3rd Party Sensor Drivers" -->"Drivers"
  • copy the following files into your working directory:
    • "common.c"
    • "HTIRS2-driver.c"

- Download this I2C - InfraRed Seeker Sample

To write your own I2C interface, you can learn it from RobotC's library code:

From RobotC Menu: File -> Open Sample Programs -> 3rd Party Driver Library -> include -> hitechnic-irseeker-v2.h

(Do note, the location may be slightly different. The key is to look for samples and the 3rd Party Driver Library.

Arduino / PI Learning



Arduino (with Uno)

Raspberry PI

Raspberry PI -
Networking Packet
Samples - access thru the internal forum :

Cross-platform with HiTechnic Proto Board

Interface NXT with another platform (essentially creating a hybrid platform with HiTechnic ProtoType Board)

More options will be added in the future. For the time being, we are using the Hitechnic Super Prototype Board.

You may download the Prototyping Guide here (from HiTechnic).  This document is copied here in December of 2012.  You should always check to see if it offers any update at its website.

You will either write your own driver code or use the driver codes available from These 2 files are:
- common.h
- hitechnic-superpro.h

Open this NXT Hybrid Supplemental Online Document to learn about how to interface this platform.

If you are advanced users, you should always learn the lower level apis without using its default driver libraries.  SR will provide more sophisticated samples at Roboclub when students are ready for them.

Here is a link to a  Hitechnic Super Prototype Board Fritzing part.  

RobotC Virtual World

Installation &
License Activation
NOTE: Scope of this section is limited to "how to run the RVW tool for Level B to II Robotics Club Exercises". This is not for SR's more advanced projects, nor is this a robotic programming tutorial. For programming tutorial, use the RobotC Packet I or Graphical RobotC Packet above.

The RVW tool is very self-explanatory and user-friendly. Therefore, students with the basic skills set should be able to self-learn and navigate around the tool; and utilize the full potential of the this virtual software.

Download and install RVW (select "LEGO")

Download and install RVW Level Builderfor creating your virtual field.

Download and install the Challenge Pack for more additional fun activities.

Need to activate license after installation

  1. Start the RobotC Virtual World IDE.
  2. Click on Help --> Add License
  3. Select Product: ROBOTC Robot Virtual Worlds
  4. Enter Your license Id and Your password
  5. Click on Activate Online
Practice their work

The following links serve as samples to get the students started. The Robot Virtual World offers a game like environment to enable students to learn robotics programming without the cost of a physical robot.

When they are at the center, they will have the opportunity to actually interact with a physical robot. With a physical robot, they will gain more in-depth insight where mechanical and physical environment come into play as well.

  Execute your Basic Movements code with the default field Challenge. Students should create own code to execute at the default field.

  Customize your own Square Race Movements Test Field. Students customize a Square field for testing.

  Execute your movements code with a custom Square Race field. Students execute their own Square Race Movements code at their customized field.

  Execute your line tracing code with a customized built Line Tracing field. Another sample for students to run their line tracing code at their own customized field.

What Ifs...
  • I want to switch machines after installation?
    Since this is a special 180-days license, you will not be able to transfer the license to another machine. You will need to purchase a new one with only $10.

    (Please do note that SR absorbs much cost in order for us to offer you this learning tool at such low cost. We are subject to the restriction dictated by the RobotC Virtual World provider. )

  • I could not find the RVW Level Builder or Challenge Pack feature?
    1. Start the RobotC Virtual World IDE.
    2. Click on Robot --> Compile Target --> Virtual World
    3. Click on Robot --> Platform Type --> LEGO Mindstorms EV3
    4. Click on Window --> Select Virtual World To Use --> Download More Packages
    5. Select RVW Level Build, and/or Challenge Pack for EV3 and/or Curriculum Companion

IMPORTANT NOTE: For any other technical questions in using additional features about Virtual World, please contact support@Robinett.


Other References

Eval Questions Graphical RobotC

(TBD) RobotC

Google Sync
Steps to install and setup your Google Sync Application on your computer.

Programming Book Ch1 to Ch10

Simple Html Template
  • Download this simple guide. This will explains almost line by line from the simple html template.
  • Get the simple html template here..
  • right click on the page
  • select view page source
  • copy to an editor, such as notepad++, or html editor

Tech 3hr Workshop - UCSEP Workshop Packet for UCSEP.