Made changes to individually control servo speeds

Dependents:   VariableSpeedServo

Fork of Servo by Jasper Denkers

Files at this revision

API Documentation at this revision

Comitter:
sierrasmith71
Date:
Wed Oct 14 02:10:23 2015 +0000
Parent:
3:774dd54867f2
Commit message:
Fixed NewPostion Variable initialization in Enable in servo.cpp

Changed in this revision

Servo.cpp Show annotated file Show diff for this revision Revisions of this file
Servo.h Show annotated file Show diff for this revision Revisions of this file
diff -r 774dd54867f2 -r 8bdb46e629b9 Servo.cpp
--- a/Servo.cpp	Mon Oct 12 14:56:58 2015 +0000
+++ b/Servo.cpp	Wed Oct 14 02:10:23 2015 +0000
@@ -54,6 +54,7 @@
     SpeedConvert(_speed);
     Period = (1000000/RefreshRate);                            //converts from HZ to period in  us
     Position = StartPos;
+    NewPosition = StartPos;
     CurrentPosition = StartPos;                              //sets CurrentPosition to  StartPos value
     Pulse.attach_us(this, &Servo::StartPulse, Period);       //starts servo period Ticker r
     Speed.attach_us(this, &Servo::Update, speed);            //starts servo Speed Ticker  speed of servo update pulse width steps in  us,    slow =100000 100ms per step
diff -r 774dd54867f2 -r 8bdb46e629b9 Servo.h
--- a/Servo.h	Mon Oct 12 14:56:58 2015 +0000
+++ b/Servo.h	Wed Oct 14 02:10:23 2015 +0000
@@ -98,7 +98,7 @@
      /** determines direction of servo's move, called by Ticker Speed
      */
      void Update();
-     
+     //int Position;
      int speed;
      int CurrentPosition;