servo motor

Dependencies:   mbed QEI Servo HIDScope MODSERIAL FXOS8700Q FastPWM

Files at this revision

API Documentation at this revision

Comitter:
IsaRobin
Date:
Tue Oct 29 13:36:02 2019 +0000
Commit message:
ServoMotor

Changed in this revision

FXOS8700Q.lib Show annotated file Show diff for this revision Revisions of this file
FastPWM.lib Show annotated file Show diff for this revision Revisions of this file
HIDScope.lib Show annotated file Show diff for this revision Revisions of this file
MODSERIAL.lib Show annotated file Show diff for this revision Revisions of this file
QEI.lib Show annotated file Show diff for this revision Revisions of this file
Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r fd4dd111fbd9 FXOS8700Q.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FXOS8700Q.lib	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Freescale/code/FXOS8700Q/#aee7dea904e2
diff -r 000000000000 -r fd4dd111fbd9 FastPWM.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FastPWM.lib	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Sissors/code/FastPWM/#c0b2265cff9c
diff -r 000000000000 -r fd4dd111fbd9 HIDScope.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HIDScope.lib	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/tomlankhorst/code/HIDScope/#d23c6edecc49
diff -r 000000000000 -r fd4dd111fbd9 MODSERIAL.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MODSERIAL.lib	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Sissors/code/MODSERIAL/#d2a5e26fd658
diff -r 000000000000 -r fd4dd111fbd9 QEI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QEI.lib	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/aberk/code/QEI/#5c2ad81551aa
diff -r 000000000000 -r fd4dd111fbd9 Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/jdenkers/code/Servo/#352133517ccc
diff -r 000000000000 -r fd4dd111fbd9 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,29 @@
+#include "Servo.h"
+#include "mbed.h"
+#include "MODSERIAL.h"
+#include "FastPWM.h"
+
+// PC connection
+MODSERIAL pc(USBTX, USBRX);
+
+int main()
+{
+pc.baud(115200);
+pc.printf("starting 1");
+Servo myservo(D3);
+int pos1 = 1000;
+int posperiod = 20000;
+myservo.Enable(pos1,posperiod);
+
+while(true) {
+    pc.printf("starting");
+    for (int pos = 1000; pos < 2000; pos += 25) {
+        myservo.SetPosition(pos);  
+        wait_ms(20);
+    }
+    for (int pos = 2000; pos > 1000; pos -= 25) {
+        myservo.SetPosition(pos); 
+        wait_ms(20); 
+        }
+    }
+    }
diff -r 000000000000 -r fd4dd111fbd9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 29 13:36:02 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file