Library for the m3pi robot. This works with a Pololu 3pi robot with the Serial Slave firmware, and exposes and API.
Fork of m3pi by
Diff: m3pi.cpp
- Revision:
- 7:9b128cebb3c2
- Parent:
- 6:62ee1486ecb9
--- a/m3pi.cpp Wed Nov 10 09:01:21 2010 +0000 +++ b/m3pi.cpp Fri Mar 25 15:44:52 2011 +0000 @@ -24,12 +24,17 @@ #include "mbed.h" #include "m3pi.h" -m3pi::m3pi(PinName nrst, PinName tx, PinName rx) : Stream("m3pi"), _nrst(nrst), _ser(tx, rx), _leds(p20,p19,p18,p17,p16,p15,p14,p13) { - _leds = 0; +m3pi::m3pi(PinName nrst, PinName tx, PinName rx) : Stream("m3pi"), _nrst(nrst), _ser(tx, rx) { _ser.baud(115200); reset(); } +m3pi::m3pi() : Stream("m3pi"), _nrst(p23), _ser(p9, p10) { + _ser.baud(115200); + reset(); +} + + void m3pi::reset () { _nrst = 0; wait (0.01); @@ -143,6 +148,8 @@ void m3pi::leds(int val) { + + BusOut _leds(p20,p19,p18,p17,p16,p15,p14,p13); _leds = val; }