Script om de servomotor uit te proberen

Dependencies:   mbed mbed

Files at this revision

API Documentation at this revision

Comitter:
lisa96m
Date:
Thu Oct 20 07:31:33 2016 +0000
Child:
1:acd79b94fe6a
Commit message:
Servomotor start script

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
cmsis.bld 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.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Thu Oct 20 07:31:33 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmsis.bld	Thu Oct 20 07:31:33 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 20 07:31:33 2016 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+#define SERIAL_BAUD 115200
+
+Serial pc(USBTX, USBRX);
+
+PwmOut servo(A4);
+double x = 0;
+float pi = 3.14;
+
+
+void loop()
+{
+    double y = sin(x);
+    {
+        x++;
+    }
+    servo = abs(y);
+    pc.printf("grootte van sinus is %f.\r\n", abs(y));
+}
+
+int main()
+{
+    pc.baud(SERIAL_BAUD);
+    while(true) {
+        loop();
+        wait(10);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Thu Oct 20 07:31:33 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/screamer/code/mbed/#aff670d0d510