Introduction to NXC and Bricx Command Center
(PDF file from the GaETC 2010 BYOL Session)

Objectives:
Use NXC Language and Bricx Command Center to write Basic Movment programs for the Lego NXT Robot

Standards:
M5P3:  Students will communicate mathematically
M5P1: Students will solve problems using appropriate technology

Definition of a Robot: A Robot is a machine that can be programmed to do a task without being directly controlled by a human being.   There are two parts to a robotic system.
1. Hardware: This is the mechanical robot. The motors, gears, wheels, parts, computers that make up the machine.  This is the part you build.

2. Software:  This is the instructions for the tasks and actions the robot will do.  This is the part you write.

NXC Language is used to create the software that controls the actions of the robot hardware.  NXC is a text based system of assembling instructions for the machine.  The flow of direction usually moves sequencially from top to bottom.  This software is an example of a compiled program.  Programs you write in NXC must be compiled with NBC and downloaded to the NXT Brick using Bricx Command Center before the Robot will perform the program.  (Scratch and Python are "Interpreted Languages.")

The website for NXC and Bricx Command Center:

http://bricxcc.sourceforge.net/

More Online Resources:

http://www.legoeducation.us/store/
http://www.ortop.org/NXT_Tutorial/

Training Robot: (Building Plans)
I use a basic, easy to build robot to teach programming. When I introduce students to robotics, we isolate the building and the programming into different lessons.  First we learn to program with a standard robot model.  Then we rebuild the robot to accomplish more complicated tasks as needed.

 Two motors that control the drive wheels are connected to the B and C ports.  The Touch, Ultrasonic, and Light Sensors are plugged into their default positions. Touch Sensor:       Port 1 Ultrasonic Sensor: Port 4 Light Sensor:         Port 3

Overview of Bricx Command Center IDE:

Basic Bricx / NXC Commands:

Motor (Output) Commands:

 OnFwd("ports", "pwr"); OnRev("ports", "pwr"); Off("ports"); OnFwdSync(“ports”, “pwr”, “turnpct”); RotateMotor(“ports”, “pwr”, “angle”);

Flow Commands:

 Wait(4000);     (milliseconds) until (“condition”); repeat (“value”) {    “body” }