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.
main.cpp
- Committer:
- Van1lla
- Date:
- 2018-11-27
- Revision:
- 3:ad5160b8ebb5
- Parent:
- 2:fbe80f505ced
File content as of revision 3:ad5160b8ebb5:
/** Servo am Digital Pin D9.
Das orange Kabel (Signal) ist links.
*/
#include "mbed.h"
#include "Servo.h"
Servo servo( D9 );
int main()
{
// Servo kalibrieren, damit er die vollen 180° verwendet.
servo.calibrate ( 0.0009, 360.0);
while ( 0 )
{
// Servo langsam bewegen (immer in der Mitte Anfangen mit Tests, sonst besteht die Gefahr von Schäden)
for ( float p = 0.9f; p <= 1.8f; p += 0.1f )
{
servo = p;
wait(0.00001);
}
wait( 0.5 );
// und die andere Seite
for ( float p = 1.8f; p >= 1.2f; p -= 1.1f )
{
servo = p;
wait(0.001);
}
wait( 0.5 );
}
}