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:3cdfbba51d93
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun May 08 14:21:34 2016 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+#include "Servo.h"
+
+Servo s1(PB_3); //pin 3 - mg995
+Servo s2(PB_4); // pin 5 - mg995
+Servo s3(PB_10); // pin 6 - mg995
+Servo s4(PC_7); // pin 9 - mg995
+Servo s5(PB_6); // pin 10 - mg996r
+Servo s6(PA_7); // pin 11 - mg996r
+Serial pc(USBTX, USBRX);
+
+int main()
+{
+ printf("Servo Full rotation:\n");
+
+ double position = 0.0;
+
+ while(1) {
+ for(double i=0.00; i<=1.00; i=i+0.01) {
+ position = i;
+
+ s1 = position;
+ s2 = position;
+ s3 = position;
+ s4 = position;
+ s5 = position;
+ s6 = position;
+ wait_ms(20);
+ }
+ printf("zavrsio 1");
+ for(double i=1.00; i>=0.00; i=i-0.01) {
+ position = i;
+
+ s1 = position;
+ s2 = position;
+ s3 = position;
+ s4 = position;
+ s5 = position;
+ s6 = position;
+ wait_ms(20);
+ }
+ printf("Zavrsio 2");
+ }
+}