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.
Diff: motors.h
- Revision:
- 0:7a97ebb833eb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/motors.h Sun May 05 00:02:11 2019 +0000
@@ -0,0 +1,26 @@
+#pragma once
+
+// Feel free to change these parameters as needed
+const float MIN_SPEED = 0.08f;
+const float MAX_SPEED = 0.8f;
+
+const int RIGHT_MOTOR = 0;
+const int LEFT_MOTOR = 1;
+
+class Motors {
+public:
+ Motors();
+ void startBaseSpeed();
+ void stop();
+
+ /***
+ * Range from 0.0-1.0.
+ ***/
+ void setLeftPwm(float pwm);
+ void setRightPwm(float pwm);
+private:
+ void setMotorPwm(int motor, float pwm);
+
+ float m_rpwm;
+ float m_lpwm;
+};