Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of m3pi_TUB by
Diff: m3pi_ng.cpp
- Revision:
- 11:7bfb33432791
- Parent:
- 10:f89d2a3a9ed2
- Child:
- 12:78fd82b3fb09
diff -r f89d2a3a9ed2 -r 7bfb33432791 m3pi_ng.cpp --- 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);