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. Please see the Legal Code under the Creative Commons
This tutorial is written to complement the guidance of center programs. This is designed mainly for Storming Robots students to perform further review and exercises at home. Therefore, the format does not present itself as a typical ideal tutorial format. However, most students at SR will find materials here quite intuitive to follow.
Looking for Competition specific materials?
The proper approach is to build the necessary foundation, and enrich your knowledge base. Then, you can apply towards a certain competition and further advance your knowledge thru proper engineering process. Focus on learning concepts applied only to a competition is like putting cart before the horse.
Recommendation: At the minimal, you should cover all the materials in RobotC Packet I under "Robotics Project Track". Robotics Packet II will be very helpful as well.
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.
For the new students who just joined us and have yet purchased the book, you may use this pdf up to ch. 10.
- Additional Exercises - last update - June/2019 -
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.
Most of our Algorithms in C/C++ students, who have completed Level B with satisfactory result, self-studied AP CS A and scored 5 by simply using the AP Baron Book.
However, for those who managed to finish level B but with lengthly assistance from instructor, these students are recommended to learn from a Java textbook.
Computer Science Track
The IDE we use...
Do note that the MS and Eclipse online links do change from time to time. This is out of our control. Therefore, if the link above does not work, you will need to search them online.
Read this first before you choose Eclipse
Although Eclipse has far smaller footprint, it is more complicated to set up to use with the debugger. Just like most OpenSource software, you might have to manually modify some system configuration. If you are not familiar with simple windows operations such as changing environment variables, navigating thru the windows file system, do NOT install Eclipse. You should install MS Visual Studio instead.
Install in the following order:
install 1.8.X JDK. (note: 1.9 caused Eclipse to fail. )
Install MinGW - Minimalist GNU for Window. Best is to get the installer kit.
install Eclipse C/C++ IDE. The latest one we used was Oxygen.
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 knowledge 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.
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 that the location may be slightly different. The key is to look for samples and the 3rd Party Driver Library.
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 I2C sensor. This video shows a setup with a Mindsensor Splitter connected to multiple i2c devices on teh same port. You can do the same type of scanning on any of the 4 input ports.
This is a sample I2C Scanning Code. Do note that samples were written with earlier version of RobotC . There may be some deprecated syntax and/or APIs. The changes required are all quite easy. If you have great difficulty in making modifications, you should go back to be fluent with the RobotC I and II first (From the "Robotics Projects Track").
Robot-C Advanced
Wireless Communication with Mindstorms via Bluetooth
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.
You have completed RobotC Packet II above.
Sample
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.
Advanced Platforms / Topics
Read this first!
We provide a lot of technical advices about other special platforms at our internal forum, such as choosing platforms, sample codes, etc.
If you are SR students, you should utlize the information provided in our internal Forum. You will need to register your email address to gain access. With google authentication enabled, you will be able to access the forum with your gmail. If your request was not granted within a couple of days, you should email us .
Do note, you must use an email address which allows us to identify as you, such as JoeySmith@gmail.com, not somethingStrange@gmail.com.
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.
Here is a sample calibration program using Mindsensor Light Array
More good ones from 3rd party samples from RobotC's installation -
from "File > Open Sample programsNXT > 3rd Party Sensor Drivers" -
look for Mindsensors array samples.)
Whenever you use a new sensor, you should always understand its behavior by performing data logging. Consult Ch. 6 in RobotC Packet II.
Should download Packet I and review the chapter in the packet before you tackle the corresponding samples.
Ch. 1
Basic programming fundamentals such as display, if, while, for. Should always start with this first.
Ch. 2
Basic programming fundamentals but with more complex logic Only for those who are more advanced. May skip to Ch.3
Ch. 3
Fundamental motors motion and navigation Should always start with this when working with motors.
Ch. 4
4.1 to 4.4: Fundamental sensors interfaces Should always start with this when working with sensors.
--
4.5 to : Fundamental in encoder interfaces May skip 4.1 to 4.4 if your exercies do not need sensors.
Ch. 5
Basic Gear Math - encoder vs distance vs degrees of rotation A must-do chapte rin order to understand encoders
Ch. 6
Motor feedback control - avoid overshooting, and sync two motors A must-do chapterin order to have more accurate movements
Ch. 7
Learn to write functions. Must learn how to write functions before tackling competition.
Ch. 8
Button control Great to use when you want to have specific manual controls, such as calibration.
Be Resourceful!...
You will be using the RobotC IDE, by the CMU Robotics Academy. This comes with a rich set of samples as well. Although it seems not to have any order of topics or complexity, you may find them very useful if you have already had intuition in computer programming.
To access it.
Use 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.
RobotC for VexIQ Packet (updated - August/2015)
DO NOTE: The RobotC Packet I and II above both apply to VexIQ as well. Except a very slight differency in motor feedback control and manipulation, almost every aspect in sensor controls are identical.
Advanced Platforms / Topics
Create Combo Sensors
Create I2C based Combo Sensors module using Arduino
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.
I2C RobotC-Arduino Packet
Advanced Platform / Topics
EV3 / Development Linux Platform
Here is a summary to help you getting you started.
(Make sure you have the latest version - July 26th, 2019. See the footer in the pdf.): Download this tutorial :
Customizing your environment configuration and shell scripting.
Basic editor w/ Plugin
GPIO Utility in both C and Python
Programming on with GPIO|I2C (w/ direct registry access) Important: You will need a logic level shifter to work with most of the i2C sensors available at SR.
Limited to "how to run the RVW tool for Level B-I Robotics Club Exercises".
RVW usage is only for about 180 days in order to allow beginning students to practice without a physical robot. This is meant to allow parents to gauge their children’s interest before investing in physical robot set.
This is not for SR's more advanced projects (Level II+), nor is this a robotic programming tutorial. For programming tutorial, use the RobotC Packet I or Graphical RobotC Packet above.
Please do note that SR absorbs much cost in order for us to offer you this learning tool at such low cost of $10 for 180 days usage. We are subject to the restriction dictated by the RobotC Virtual World provider.
IMPORTANT: : This license is ONLY good for ONE activation as per CMU Robotic Academy terms. If you intend on switching computers before the 180-day license expires, you will have to deactivate it and reactivate it on the new computer. Storming Robots will not be able to reissue another one for you under this circumstances.
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 potential of the this virtual software.
Detailed Guide from installation to execution of your 1st program
This document will include step by step instructions from installation to practice.
This document will show you a sample practice with line tracking.
This document will give you an idea what is required in all the challenges avaliable in the RVW Challenge Packet.
Videos shows you how to start up with basic exercises and do test. The testing process is the same no matter whether you are using RobotC or Graphical RobotC.
Find a web-hosting online site. Some will also have webpages editing tools, such as Wordpress com, SquareSpace / Wix, etc.
Or, you can write your own single webpage.
You may then use their tools to create a fancy looking site. (If you are one of the more advanced students in SR, you may find preset templates are too confining to work with. You may end up spending more time to work with their templates than writing my own site on my own. )
Should know some bare basics in html...
This pdf will explains almost line by line from the simple html template. After you open this page, do the following: