Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 11:fe157aefa7e7, committed 2018-05-02
- 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 |
--- 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;
--- 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