This is the code we showed at Uncraftivism

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ServoMinder.h Source File

ServoMinder.h

00001 #pragma once
00002 #include "Servo.h"
00003 
00004 class ServoMinder
00005 {
00006 public:
00007     ServoMinder( Servo *servo );
00008 
00009     void moveTo( float target );
00010     void moveToAndWait( float target );
00011      void setSpeed( float speed );
00012      bool isMoving();
00013      
00014 private:
00015    
00016 
00017     Servo *m_servo;
00018     float m_target;
00019     float m_speed;
00020 
00021     float m_delta;
00022     float m_tickTime;
00023     Ticker m_ticker;
00024 
00025     void tick();
00026 
00027 };