Programming With NQC by Lonnie Cohen

NQC Programming Basics

  1. Preliminaries: Installing the Firmware.

  2. The NQC Language (ppt)

  3. NQC Programmer's Reference Sheet - NQC 2.2 r1 - Target RCX2 - by Matthew Bates

Sample Programs

The following sample programs are presented in a progressive manner, starting with the simplest of capabilities and building to more complicated program structures.

  1. Out the Door
    This is a simple program with one main task. It gets the robot out the door.

  2. Bump A Lot
    In this program we use the while(true) infinite loop and a second task.

  3. Bump A Lot 2
    Bump A Lot is modified to utilize  in-line functions, playsoundL and playsoundR, to make audible tones corresponding to the direction the robot turns.

  4. Scanner 1
    Robot searches for a light source, locks on to that source, and travels in that direction.

  5. Scanner 2
    Blends capabilities of Scanner 1 with Bump A Lot 2.

Sample Robot Designs

These robot designs are sufficient to run the sample programs above. Other designs may also work well with these programs.

  1. Tankbot Construction
    A simple yet strong robot with two motors. This is the minimal robot for Out the Door

  2. Scanbot Construction
    Based on the Tankbot design, we add one more motor to rotate the scanner and a rotation sensor for feedback.

Communication Between the Robot and Tower 

Robot to Tower communications. 

  1. Tower Communications
    The robot communicates back to the computer via the IR tower.