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-STM32F103C8T6 mbed
Diff: main.cpp
- Revision:
- 1:c86ffbbf8803
- Parent:
- 0:2d3da2f0f265
diff -r 2d3da2f0f265 -r c86ffbbf8803 main.cpp
--- a/main.cpp Sat Apr 07 08:18:51 2018 +0000
+++ b/main.cpp Sat Apr 07 12:27:25 2018 +0000
@@ -1,20 +1,19 @@
#include "mbed.h"
#include "stm32f103c8t6.h"
-#define position (100 / 20)
+#define position 0.05
-PwmOut Servo(PB_6);
+PwmOut Servo(PA_8);
int main() {
confSysClock();
Servo.period_ms(20);
while(1) {
- Servo = position * 1.5;
- wait(1000);
- Servo = position * 1.0;
- wait(1000);
- Servo = position * 2.0;
- wait(1000);
-
+ Servo = position * 0.545; // max right
+ wait_ms(1000);
+ Servo = position * 1.5; //center
+ wait_ms(1000);
+ Servo = position * 2.6; //max left
+ wait_ms(1000);
}
}