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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:0d63c17e7b7a
diff -r 000000000000 -r 0d63c17e7b7a main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jan 19 10:46:46 2021 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+
+PwmOut servo(p21);
+
+void servo_joueur();
+
+int main()
+{
+ servo.period_ms(20);
+ // servo.pulsewidth_us(2325/2);
+ while(1)
+ {
+ servo_joueur();
+ }
+}
+
+void servo_joueur(void)
+{
+ servo.pulsewidth_us(1000);
+ wait_ms(750);
+ servo.pulsewidth_us(2200);
+ wait_ms(750);
+}