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.
Diff: main.cpp
- Revision:
- 0:e6f25efb6af9
- Child:
- 1:32f0eb92121b
diff -r 000000000000 -r e6f25efb6af9 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Mar 23 17:10:05 2015 +0000
@@ -0,0 +1,28 @@
+/** Servo
+*/
+#include "mbed.h"
+#include "Servo.h"
+
+Servo servo(A5);
+
+int main()
+{
+ while ( 1 )
+ {
+ // Servo langsam bewegen (immer in der Mitte Anfangen mit Tests, sonst besteht die Gefahr von Schäden)
+ for ( float p = 0.4f; p < 0.6f; p += 0.0001f )
+ {
+ servo = p;
+ wait(0.001);
+ }
+ wait( 1.0 );
+ // und die andere Seite
+ for ( float p = 0.6f; p >= 0.4f; p -= 0.0001f )
+ {
+ servo = p;
+ wait(0.001);
+ }
+ wait( 1.0 );
+ }
+}
+
\ No newline at end of file