To give access to functions to control the MBot, import the RTT library.
#include "rttimport.h"
The following functions are available after including the RTT library.
drive(int speed);
// drive forward with speed speed, which may range from 1-100
leftWheel(int speed);
// move left wheel with speed speed
rightWheel(int speed);
// move right wheel with speed speed
stopDrive();
// stop moving
lineSensor.readSensors()
/* read both sensors
returns 0x00 if both left and right sensors are over a black line
returns 0x01 if left sensor is over a black line but the right sensor is not
returns 0x02 if left sensor is not over a black line but the right sensor is
returns 0x03 if neither left sensor nor the right sensor is over a black line */
lineSensor.readSensorLeft()
// read state of left sensor
// returns 0 if over black line, returns 1 if not over black line
lineSensor.readSensorRight()
// read state of right sensor
// returns 0 if over black line, returns 1 if not over black line