Home Page | Language Reference (extended) | SD Reference | Libraries | Comparison | Changes

Robot library

The Robot library is included with Arduino IDE 1.0.5 and later.

The Robot has a number of built in sensors and actuators. The library is designed to easily access the robot's functionality.

The robot has two boards, a motor board and control board. Each board has a separate programmable processor.

The library allows you to interface with the various sensors and peripherals on the control board :

  • potentiometer
  • 5 momentary switches
  • 160x120 pixel color screen
  • 512Kbit EEPROM
  • speaker
  • compass
  • 3 I2C connectors
  • 8 TinkerKit input connectors

The library also enables you to do a number of things with the motor board :

  • control motor speed and direction
  • sense the current used by each motor
  • read the state of the 5 floor sensors (also known as line detection sensors)
  • access I/O pins on the board
  • control an I2C port
  • read the state of 4 TinkerKit inputs

For more information about the Robot, visit the Fat16, EasyTransfer, Squawk, and IRRemote. It also relies on a number of Arduino libraries like TFT, SPI, and Wire. Their functionality has been replicated inside the robot's library to optimize the code's size.

It is possible to program both the Control and the Motor boards. However, it is recommended that novice programmers begin with programming the control board, leaving the motor board for later. The library exposes the sensors on both boards through a single object.

There are two main subjects that command the robot:

  • RobotControl: commands the Control Board as well as the I/Os and motors on the Motor Board, when running the default firmware.
  • RobotMotor: commands the Motor Board. Use it to make your own custom version of the Motor Board firmware

Examples

These illustrate the possibilities of the robot to help you get up and running quickly with the basic functionality.

RobotMotor class

Use this to make your own firmware for the Motor Board.

Read this document to learn about making your own firmware for the motor board using the RobotMotor class.


Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.