SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.
Dependencies: TSI USBDevice mbed-dev
Fork of SmartWheels by
Diff: Hardwares/Servo.h
- Revision:
- 11:676ea42afd56
- Child:
- 14:88302da8bff0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Hardwares/Servo.h Tue Feb 07 21:58:20 2017 +0000 @@ -0,0 +1,42 @@ +#pragma once + +#include <mbed.h> + +namespace SW +{ + class Core; +} + +#define SERVO_RT 1 +#define SERVO_LF -1 + +#define SERVO_MAX_ANGLE 19.0f + +class Servo +{ + +public: + + Servo(SW::Core& core); + + ~Servo(); + + void Update(float deltaTime); + + void setAngle(float angle); + + //void turnRight(float angle); + + //void turnLeft(float angle); + +private: + + SW::Core& m_core; + + float m_pulseWidth; + + PwmOut m_pwm; + + Servo(); + +}; \ No newline at end of file