![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Servo script + magnet driver for biorobotics project in Uni. Made by Teun van der Molen
Dependencies: MODSERIAL Servo mbed
Revision 2:37d109555c95, committed 2015-10-19
- Comitter:
- teunman
- Date:
- Mon Oct 19 10:00:03 2015 +0000
- Parent:
- 1:26baa438620b
- Commit message:
- latest version of servo. Cleaned up some documentation;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 26baa438620b -r 37d109555c95 main.cpp --- a/main.cpp Mon Sep 28 14:27:06 2015 +0000 +++ b/main.cpp Mon Oct 19 10:00:03 2015 +0000 @@ -1,5 +1,4 @@ #include "mbed.h" - #include "Servo.h" @@ -11,11 +10,11 @@ int main() { - Servo swagvo(D4); //devine the port for controlling the servo (this cannot be a PWM port !!!) + Servo swagvo(D4); //devine the port for controlling the servo (this cannot be a PWM port (i think) !!!) int down = 0; //counter green = 1; -swagvo.Enable(2350,20000); //turning on the servo (starting position,frequency (50 Hz do not change!!!)) +swagvo.Enable(1500,20000); //turning on the servo (starting position,frequency (50 Hz do not change!!!)) // The servo has the following positions (fully left: 650, center (1500), fully right (2350)) these values prevent the servo from grinding so do not exceed them while(true) {