RCKit
Main Page
Classes
Files
Examples
File List
File Members
ServoSetter.h
1
// ServoSetter.h
2
//
3
// Setter class that outputs its value to a Servo
4
/// \author Mike McCauley (mikem@airspayce.com)
5
///
6
// Copyright (C) 2010 Mike McCauley
7
// $Id: ServoSetter.h,v 1.2 2010/06/21 01:33:53 mikem Exp $
8
9
#ifndef ServoSetter_h
10
#define ServoSetter_h
11
12
#include "Setter.h"
13
14
class
Servo;
15
16
/////////////////////////////////////////////////////////////////////
17
/// \class ServoSetter ServoSetter.h <ServoSetter.h>
18
/// \brief Setter class that limits its input to between specified min and max values
19
///
20
class
ServoSetter
:
public
Setter
21
{
22
public
:
23
/// \param[in] servo The target Servo instance. It is the callers job to attach the Servo to
24
/// the servo output pin
25
ServoSetter
(Servo* servo);
26
27
/// Input the value to be used to set the servo
28
/// Servos are controlled within the range 0 to 180 degrees
29
/// Input values in the range 0-255 are scaled to 0-180
30
/// Values outside that range are limited to 0 and 255
31
/// \param[in] value The input value
32
virtual
void
input
(
int
value);
33
34
/// Called when the source of input data is lost, and the Setter is required to fail in a safe way
35
virtual
void
failsafe
();
36
37
protected
:
38
39
private
:
40
Servo* _servo;
41
};
42
43
#endif
Generated by
1.8.1