JMotor
Loading...
Searching...
No Matches
JMotorDriverServo.h
Go to the documentation of this file.
1#ifndef J_MOTOR_DRIVER_SERVO_H
2#define J_MOTOR_DRIVER_SERVO_H
3#include "JMotorDriver.h"
4#include <Arduino.h>
9protected:
17
18public:
23 void setMinServoValue(int value)
24 {
25 minServoValue = value;
26 }
31 void setMaxServoValue(int value)
32 {
33 maxServoValue = value;
34 }
40 {
41 return minServoValue;
42 }
48 {
49 return maxServoValue;
50 }
56 {
58 }
64 void setServoValues(int min, int max)
65 {
68 }
69
75 {
76 return setMicroseconds;
77 }
83 {
84 return constrainRange;
85 }
90 void setConstrainRange(bool _constrainRange)
91 {
92 constrainRange = _constrainRange;
93 }
94};
95#endif
defines common interface for all types of JMotorDrivers
Definition JMotorDriver.h:10
class that can be used to specify a driver that controls specifically a servo
Definition JMotorDriverServo.h:8
void setServoValues(int min, int max)
set the settings for short and long servo pulses at the same time
Definition JMotorDriverServo.h:64
int getServoValueRange()
returns difference (in microseconds) between longest and shortest servo pulse settings
Definition JMotorDriverServo.h:55
void setMinServoValue(int value)
microseconds for shortest servo pulse
Definition JMotorDriverServo.h:23
int maxServoValue
Definition JMotorDriverServo.h:11
void setMaxServoValue(int value)
microseconds for longest servo pulse
Definition JMotorDriverServo.h:31
bool constrainRange
Definition JMotorDriverServo.h:16
int getMaxServoValue()
returns setting for microseconds for longest servo pulse
Definition JMotorDriverServo.h:47
int setMicroseconds
Definition JMotorDriverServo.h:15
int getSetMicroseconds()
returns how many microseconds the servo signal pulse was most recently set to
Definition JMotorDriverServo.h:74
int getMinServoValue()
returns setting for microseconds for shortest servo pulse
Definition JMotorDriverServo.h:39
int minServoValue
Definition JMotorDriverServo.h:10
bool getConstrainRange()
returns whether the range of set() will be constrained to within -1 and 1
Definition JMotorDriverServo.h:82
void setConstrainRange(bool _constrainRange)
set whether the range of set() will be constrained to within -1 and 1
Definition JMotorDriverServo.h:90