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: include/Drivers/servo.hpp
- Revision:
- 1:ceee5a608e7c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/Drivers/servo.hpp Thu Mar 28 07:44:42 2019 +0000
@@ -0,0 +1,44 @@
+/**
+ ******************************************************************************
+ * @file SERVO.hpp
+ * @author RBRO/PJ-IU
+ * @version V1.0.0
+ * @date day-month-2017
+ * @brief This file contains the class declaration for the steering SERVO
+ * functionality.
+ ******************************************************************************
+ */
+
+/* Include guard */
+#ifndef SERVO_HPP
+#define SERVO_HPP
+
+#include <mbed.h>
+
+
+namespace drivers{
+ /**
+ * @brief It is used for implementing SERVO functionality.
+ *
+ */
+ class SERVO
+ {
+ public:
+ /* Constructor */
+ SERVO(PinName _pwm);
+ /* Destructor */
+ ~SERVO();
+ /* Set angle */
+ void SetAngle(float angle); //-25 to 25 degr
+ private:
+ /* convert angle to duty cycle */
+ float conversion(float angle); //angle to duty cycle
+ /* PWM value */
+ PwmOut pwm;
+ /* Current angle */
+ float current_angle;
+ };
+}; // namespace drivers
+
+
+#endif