asdasd

Fork of m3pi by Chris Styles

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Sun Nov 07 09:57:11 2010 +0000
Parent:
3:c38d2f980494
Child:
5:09fb0636207b
Commit message:
Modified reset routine, and code to switch the LEDs off

Changed in this revision

m3pi.cpp Show annotated file Show diff for this revision Revisions of this file
m3pi.h Show annotated file Show diff for this revision Revisions of this file
--- a/m3pi.cpp	Mon Nov 01 23:30:09 2010 +0000
+++ b/m3pi.cpp	Sun Nov 07 09:57:11 2010 +0000
@@ -24,7 +24,8 @@
 #include "mbed.h"
 #include "m3pi.h"
 
-m3pi::m3pi(PinName nrst, PinName tx, PinName rx) :  Stream("m3pi"), _nrst(nrst), _ser(tx, rx)  {
+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;
     _ser.baud(115200);
     reset();
 }
@@ -33,6 +34,7 @@
     _nrst = 0;
     wait (0.01);
     _nrst = 1;
+    wait (0.01);
 }
 
 void m3pi::left_motor (float speed) {
--- a/m3pi.h	Mon Nov 01 23:30:09 2010 +0000
+++ b/m3pi.h	Sun Nov 07 09:57:11 2010 +0000
@@ -218,6 +218,8 @@
 
     DigitalOut _nrst;
     Serial _ser;
+    BusOut _leds;
+    
     void motor (int motor, float speed);
     virtual int _putc(int c);
     virtual int _getc();