Here are a few code snippets for CEENBoT Commander....

To reset the board back to factory firmware:


To move forward:


To drive a square:

This program uses the loop tool.


Programming the Remote:

This program uses the digital up/down/left/right and X button to drive the robot. To read inputs from the robot you must use a loop. The input commands just read the input device (Remote) or sensor (Proximity) just once and set a variable. If you don't use a loop the robot will read the input like the remote before you have had a chance push any buttons. When you put the input commands into a loop, the robot will continuously read and process the input values.

In this program the digital controls will just change the direction (forward/backward) in freerunning mode. This will cause the robot to start a move like forward or rotate left, and continue that move until another key is pressed. This will give a unique driver experience. You can also try turning in blocking mode using different values for turning distance. There are many modifications possible that will change the driver experience.

Thanks Steve Hamersky - More information can be found at: and


How to use the three buttons, modules, branch, loop and goto commands:

This program uses the "S3, S4, and S5" buttons on the board. To read inputs from the buttons you must use a loop. The pressed button will set a variable. The branch will then determine if it was switch was pressed and send the program to the proper module. At the end of each module, you will need to use the "set" command to set the variable back to 0.


zip file of switch program: or

Reading from line-following sensors (reading the analog value of an infrared transmitter/receiver):


This challenge requires connecting two additional hardware components to the CEENBoT through the 20 pin connector of the robot controller board. We will provide a small circuit board that will make this connection easier.
See IR board pictures.

Each line-following sensor is connected to power, ground and the analog-to-digital (ADC) input on the 20 pin connector, pins 1 and 2. The hardware pins correspond to a CEENBoT Commander ADC tool channel number. Pin 1 is channel 1. Pin 2 is channel 2. Keep your sensor, the pin it connects to, and the channel you use in your Commander program clear in your mind or you may get confused about which sensor you are reading. You may want to get one sensor working first and then the other.

Getting a value from the line following requires a little programming. Here is one way to do it:
  • In the Start tool, create a variable for each ADC input to store the value read from the sensor.
  • Give the variable a name that means something to you, like "LeftSideLine". Remember, no spaces are allowed in a variable name.
  • Make the variable type an integer.
  • If you want, you can set an initial value between 0 and 1023

  • Drop an ADC tool for each ADC input onto the workspace and connect it into the program.
  • In each ADC tool, set the variable where the value of the line-following sensor input will be stored.
  • Also in each tool, select the channel the tool will read. You will need to have a different tool and channel selected for each line-following sensor.

When the input part of your program runs, a numeric value from each sensor is stored in the variable you created. The variable will be between 0 and 1023. A lower number indicates more light or less dark is under the sensor. By manipulating the two variables and comparing them, you can get an idea of where the robot is in relation to the line on the floor and decide what you want the robot to do.