Hardware Reference
In-Depth Information
Control a LEGO Robot
HACK 34
What could be cooler than a functioning, programmable robot made
from LEGO bricks? A functioning, programmable LEGO robot connected
to and controlled by a Raspberry Pi.
We love LEGO. Possibly more than our kids do (or ever will). We've also been fans of
the LEGO Mindstorms kits for a long time. The LEGO Mindstorms kits are a combi-
nation of LEGO (and Technic-style) bricks and electronic components such as sen-
sors, motors, and a programmable brick.
The brick is especially notable because it is the “brain” of the Mindstorms set, and
you can program it directly to control the peripheral devices in the kit. The brick in the
most recent version of the LEGO Mindstorms (LEGO Mindstorms NXT 2.0, as of this
writing) is, unsurprisingly, called the NXT Intelligent Brick, and it's pretty cool (see
Figure 3-10 ).
Figure 3-10.
NXT Intelligent Brick
At its core, the NXT Intelligent Brick is powered by a 32-bit Atmel AT91SAM7S256
microcontroller (with 256 KB flash memory and 64 KB RAM) and an 8-bit Atmel AT-
mega48 microcontroller running at 4 MHz. It has an embedded 100x64 pixel LCD
screen (controlled by push buttons below it) with support for four input devices (ports
1-4) and three output devices (ports A-C).
It also supports both Bluetooth and USB connections, which is important because,
while you can program the brick itself to operate the attached devices for the robot
(with simple programs), you can also control the brick directly via USB, and that is
exactly how you'll do it in this hack.
Search WWH ::




Custom Search