Matbotics  0.2
An Arduino library to control Matrix Robotics Controller
Matbotics Documentation

Matbotics is a Arduino library to control Matrix Robotics System controller. Matbotics uses Arduino I2C master library to support repeat start, because Wire library (issued with the Arduino IDE) does not.

Features

Installation (Unix like systems)

Open a terminal and run :

1 $ cd <UserDirectory>/Arduino/libraries
2 $ git clone https://github.com/blasterbug/Matbotics.git

Now after (re)starting the Arduino IDE you shloud see Matbotics in Arduino libraries menu.

Exemple

This exemple shows how to control a servo plugged to the port one

1 // import libraries
2 #include <I2C.h>
3 #include <Matbotics.h>
4 
5 // use the controller
6 MTController ctlr;
7 
8 void setup()
9 {
10  // enable servos
11  ctlr.enableServos();
12  // switchoff timeout
13  ctlr.timeout( 0 );
14  // set a custom speed for the servo one
15  ctlr.servoOneSpeed( 5 );
16 }
17 
18 // some variables
19 int angle = 0;
20 
21 void loop()
22 {
23  // increase angle and stay in boundaries
24  angle = (angle + 10)%250;
25  // set the angle to the first servo
26  ctlr.servoOneAngle( angle );
27  delay( 600 );
28 }

TODO

Connect Lego Mindstorms devices to Arduino boards

NXT clipped off wire

NXT uses RJ12 wires made like this :

Connect the red and the black wire to Arduino ground pin, the yellow to a SCL pin and the blue one to a SDA pin. On Arduino boards this pins are clearly identified.