Notes on the Code In VB 6.0

About Us        Downloads        Code        Project        Research        Journal




When we first began programming, the previous programmers did not have very clear commentation, if any commentation at all. Disecting the code was a large step in our over all programming of the I-robot. In order to get the I-robot to do what we wanted it to through logic rather than through guess and test we needed to add our own commentation to the program. Below we have a sample of a few of the functions we wrote for the robot, including the definition of some of the OP codes.

For Example:

Below is the code that initializes the robot to go forward:

f(0) = 128
f(1) = 130
f(2) = 137

This is how to initialize the robot to move forward. The code 128 is always the first bit sent to the robot and tells the robot that there will be information being sent to it. Thus the robot is ready to recieve information after this command.

The code 130 sets the robot into safe mode.

Safe Mode:
When you send a Safe command to the IO, Create enters into Safe mode. Safe mode gives you full control over Create, with the exception of the following safety-related conditions:

1.)Detection of a cliff while moving forward (or moving backward with a small turning radius, less than one robot radius).
2.)Detection of a wheel drop (on any wheel)
3.)Charger plugged in and powered.

Should one of the above safety-related conditions occur while the IO is in Safe mode, Create stops all motors and reverts to Passive mode.

Some of the definitions above are from the manufacturers website: iRobot.com