Library for the m3pi robot. This works with a Pololu 3pi robot with the Serial Slave firmware, and exposes and API. This is a fork of cstyles m3pi library.

Dependencies:   btbee

Dependents:   configure_btbee m3pi_btTest Test_SlowDown TurnAround ... more

Fork of m3pi by Chris Styles

Revision:
11:7bfb33432791
Parent:
10:f89d2a3a9ed2
Child:
12:78fd82b3fb09
--- a/m3pi_ng.cpp	Tue May 14 11:05:33 2013 +0000
+++ b/m3pi_ng.cpp	Fri May 17 14:04:12 2013 +0000
@@ -73,6 +73,19 @@
     }
 }
 
+void m3pi::slowstop (float speed, float waittime, int steps) {  
+  for (int i=2; i<steps ; i++)
+    {
+     float slowed;
+      slowed=speed*float(steps-i)/float(steps);    
+     motor(0,slowed);
+     motor(1,slowed);
+     wait(waittime);
+    }
+     motor(0,0);
+     motor(1,0);    
+}
+
 void m3pi::reset () {
     _nrst = 0;
     wait (0.01);