Motor driver library for the AP1017.

/media/uploads/tkstreet/akm_name_logo.png

AKM Development Platform

AP1017 Motor Driver

Import libraryAP1017

Motor driver library for the AP1017.

Files at this revision

API Documentation at this revision

Comitter:
tkstreet
Date:
Wed May 02 19:51:16 2018 +0000
Parent:
10:16d45e3f4be3
Commit message:
Changed all float values to double precision.

Changed in this revision

AP1017.cpp Show annotated file Show diff for this revision Revisions of this file
AP1017.h Show annotated file Show diff for this revision Revisions of this file
diff -r 16d45e3f4be3 -r fe157aefa7e7 AP1017.cpp
--- a/AP1017.cpp	Wed Nov 08 21:37:24 2017 +0000
+++ b/AP1017.cpp	Wed May 02 19:51:16 2018 +0000
@@ -99,7 +99,7 @@
 }
 
 
-AP1017::Status AP1017::setSpeed(float dc)
+AP1017::Status AP1017::setSpeed(double dc)
 {
     if((dc <= 100.0) && (dc >= 0.0))
     {
@@ -120,7 +120,7 @@
 }
 
 
-float AP1017::getSpeed(void)
+double AP1017::getSpeed(void)
 {
     MSG("Speed: %.1f%%\r\n.", dutyCycle*100.0);
     return dutyCycle*100.0;
diff -r 16d45e3f4be3 -r fe157aefa7e7 AP1017.h
--- a/AP1017.h	Wed Nov 08 21:37:24 2017 +0000
+++ b/AP1017.h	Wed May 02 19:51:16 2018 +0000
@@ -72,12 +72,12 @@
      * @param dc Duty cycle as a proportion (0.0 to 1.0).
      * @return Returns successful termination or dutyc cyle error.
      */
-    Status  setSpeed(float dc);
+    Status  setSpeed(double dc);
 
     /**
      * Returns the currently set speed as a percentage.
      */
-    float getSpeed(void);
+    double getSpeed(void);
 
     /**
      * Engages the motor.
@@ -117,7 +117,7 @@
 private:
 
     bool        motorOn;            // Status flag for the motor
-    float       dutyCycle;          // Given as proportion: 0.00 to 1.00
+    double      dutyCycle;          // Given as proportion: 0.00 to 1.00
     Rotation    direction;
     
     TCA9554A    *motor;              // Motor object