User Manual
libraries/m3pi]; many of the serial-slave commands are supported by the m3pi library. To use the library
in your mbed program, either base your program off of an existing m3pi program or click the “import
this library into a program” link on the m3pi library webpage.
If you are using the m3pi expansion kit to upgrade your 3pi robot to an mbed-controlled
m3pi robot, you should use your AVR programmer to load the serial slave program
[https://www.pololu.com/docs/0J21/10.a] onto the 3pi. The source code for the serial slave
program is included with the Pololu AVR library [https://www.pololu.com/docs/0J20], as is a
precompiled hex file.
Technical Details
To control the base, the mbed communicates serially with the 3pi’s serial slave program at 115,200
bps. If you ordered a fully-assembled m3pi robot, the included 3pi ships with a special demo program
that waits for five seconds on startup for a serial command. If the 3pi does not receive a serial
command during this initial five seconds, it goes into a demo mode that shows off the various features
of the 3pi. To avoid going into demo mode, the mbed should at least send one command within the
first 5 seconds of turning on (a good choice would be m3pi.cls(), which clears the LCD).
For more information on how the mbed connects to the 3pi base and other m3pi peripherals, see
Section 4. The m3pi mbed library makes it possible to use the m3pi robot without knowing exactly
which pins connect to which peripherals, but advanced users might find this information useful if they
are modifying the library or writing their own.
3.b. Wixel in Control
The m3pi robot has a socket for a Wixel module [https://www.pololu.com/product/1336]. The Wixel can be
used with its stock wireless serial app to easily add wireless functionality to your m3pi robot, or you
can take it a step further and program it to act as the main controller of your m3pi.
As long as the m3pi expansion board has shorting blocks on its three serial jumpers and the 3pi robot
base is running its stock serial slave program (or the most recent version of the 3pi demo program),
a socketed Wixel can control the 3pi base through a series of serial commands while simultaneously
performing high-level tasks like wireless communication, route planning, and sensor processing.
There is currently no Wixel library specifically for controlling the m3pi, so there is a bit more
programming involved in getting started with the Wixel than with the mbed. The serial commands for
controlling the 3pi base are documented in the section of the 3pi user’s guide on the serial slave
program [https://www.pololu.com/docs/0J21/10.a]. The 3pi robot included with the fully-assembled m3pi is
pre-programed with this serial slave program.
Pololu m3pi User’s Guide © 2001–2017 Pololu Corporation
3. Using the m3pi Page 21 of 39










