cis32 robot lab #1

Wednesday, February 22, 2006

sklar/spring-2006

  1. Create a folder called cis32 on the desktop of your laptop. Copy the program basic.nqc from the USB stick (that I pass around in class) onto your computer.

  2. Make sure that your communication tower is plugged into one of the USB ports on the back of your laptop.
    Make sure that your RCX is turned on and lined up so that its IR receiver (the black area on the front of the brick) faces the communication tower.
    Double-click on the bricxcc icon on the desktop.
    Note that when the bricx command center initializes, it checks to make sure it can communicate with the RCX. This is why you should have the RCX turned on and set facing the communication tower. Also note that this initialization process does not run correctly if you start up bricxcc by clicking on a NQC file. Instead, always start from the bricxcc icon on the desktop!

  3. Try compiling, downloading and running the basic program.
    To compile in bricx, select Compile - Compile.
    To download your compiled code onto the RCX, select Compile - Download.
    To run your program, press the run button on your RCX.

    The sample basic program should start by going forward until the touch sensor is pressed, then the robot will back up for 2 seconds, then it will turn for 1 second and then it will go forward again. Make sure your robot behaves in this way. If it does not begin by going forward, then you can reverse the leads going from the motors to the RCX. In other words, if the wires coming out of the leads attached to the RCX are facing out, then rotate each square connector piece so that the leads are facing in.

  4. Create basic2.nqc by copying basic.nqc. Modify the new program so that the robot goes forward for 5 seconds and then stops completely.

  5. Create basic3.nqc by copying basic2.nqc. Modify the program so that the robot goes forward for 5 seconds, then stops until the touch sensor is pressed, then goes backwards for 5 seconds and then stops completely.

  6. Create basic4.nqc by copying basic3.nqc. Modify the program so that the robot goes forward until it drives over a black line, then stops completely.

  7. Create basic5.nqc by copying basic4.nqc. Modify the program so that it follows a black line taped to the floor. Remember the hint I showed in class: you are really following the edge of the line, where black meets white. You can follow either the left or the right edge of the black line.