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: motor.h
- Revision:
- 2:bc41daf2b0ce
- Parent:
- 1:3ca91ad8e927
--- a/motor.h Fri Dec 14 14:24:52 2018 +0000
+++ b/motor.h Mon Dec 17 11:09:11 2018 +0000
@@ -1,6 +1,41 @@
#ifndef _MOTOR_H_
#define _MOTOR_H_
#include "mbed.h"
+
+ namespace mbed {
+ /** \addtogroup drivers */
+
+ /** A Motor Driver, used for setting the pins for PWM Outpu
+ * for use with ROCO104
+ *
+ * @note Synchronization level: Interrupt safe
+ *
+ * Example:
+ * @code
+ * // Toggle a LED
+ * #include "mbed.h"
+ *
+ * Motor Wheels(D15,D14,D13,D12);
+ *
+ * int main()
+ * {
+ * Wheel.Period_in_ms(2);//Set frequency of the PWMs 500Hz
+ * while(true)
+ * {
+ * Wheel.Speed(0.8,0.8);//Forward 80%
+ * wait(5.0);
+ * Wheel.stop();
+ * wait(1.0);
+ * Wheel.Speed(-0.8,-0.8);//Reverse 80%
+ * wait(5.0);
+ * Wheel.stop();
+ * wait(1.0);
+ * }
+ * }
+ * @endcode
+ */
+ } // namespace mbed
+
class Motor
{
public: