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.
Dependencies: mbed mbed-rtos MotionSensor EthernetInterface
Diff: Motor/Motor.h
- Revision:
- 12:273752f540be
- Child:
- 20:7138ab2f93f7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Motor/Motor.h Sat Apr 30 21:23:13 2016 +0000
@@ -0,0 +1,31 @@
+#ifndef MOTOR_HEADER
+#define MOTOR_HEADER
+
+#include "mbed.h"
+#include "CarPWM.h"
+
+class Motor{
+
+ protected:
+ Ticker interruption;
+ bool alternate_motor;
+ float velocity;
+ float jog_duty_cycle;
+ float jog_period;
+ PwmOut motor;
+
+public:
+
+ void startJogging(float jog_dc, float jog_p);
+ void stopJogging(void);
+ void brakeMotor(void);
+ void reverseMotor(int speed);
+ void setVelocity(int new_velocity);
+ void setSmoothVelocity(int new_velocity);
+ Motor(): motor(PTD1){}
+
+private:
+ void motorJogging(void);
+
+};
+#endif
\ No newline at end of file