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 Motor by
main.cpp
- Committer:
- stefan1691
- Date:
- 2015-03-25
- Revision:
- 1:cd92955f8d4b
- Parent:
- 0:6d98ef70e4b9
- Child:
- 2:c9df6ce2f77d
File content as of revision 1:cd92955f8d4b:
/** Motor Beispiel Motor an den oberen 2 Pins einstecken. */ #include "mbed.h" #include "Motor.h" Motor m1(D3, D2, D4); // PWM, Vorwaerts, Rueckwarts int main() { printf( "Motor Test\n" ); while ( 1 ) { // rueckwaerts printf( "rueckwaerts\n" ); for (double s= 0.5; s < 1.0 ; s += 0.01) { m1.speed(s * -1); wait(0.4); } m1.speed( 0 ); wait( 1.0 ); printf( "vorwaerts\n" ); for (double s= 0.5; s < 1.0 ; s += 0.01) { m1.speed(s); wait(0.4); } m1.speed( 0 ); wait( 1.0 ); } }