Tests the motor
Dependencies: btbee
Fork of m3pi_ng by
Diff: m3pi_ng.cpp
- 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);