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 haofan Zheng

Hardwares/Servo.h

Committer:
Bobymicjohn
Date:
2017-02-07
Revision:
11:676ea42afd56
Child:
14:88302da8bff0

File content as of revision 11:676ea42afd56:

#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();

};