JMotor
|
implements JServoStallSensing interface. More...
#include <JServoCurrentSensor.h>
Public Member Functions | |
JServoCurrentSensor (int _measurePin, int _maxRange=1000, int _minRange=0) | |
constructor for JServoCurrentSensor | |
float | getMeasurement (bool _run=true) |
int | getUnscaledMeasurement () |
bool | getJustStarted () |
int | getMinRange () |
int | getMaxRange () |
void | setMinRange (int min) |
void | setMaxRange (int max) |
void | setMeasurementPin (byte _newPin) |
byte | getMeasurementPin () |
void | run () |
Protected Attributes | |
int | measurePin |
bool | justStarted |
int | readings [N] |
byte | readIndex |
long | total |
unsigned long | lastMeasurementMillis |
long | measurementRaw |
int | minRange |
int | maxRange |
implements JServoStallSensing interface.
averages N number of readings, use like: JServoCurrentSensor<40> stallSensor = JServoCurrentSensor<40>(pin);
takes and filters current readings to calculate how hard a servo is working add a small amount of resistance to the negative power wire of a servo (a small bundle of wire can create enough resistance) connect the measuring pin to the negative wire close to the servo so the voltage drop across the resistance can be measured.
|
inline |
constructor for JServoCurrentSensor
_measurePin | analog pin reading signal that corresponds to how much current a servo is drawing |
_maxRange | |
_minRange |
|
inline |
|
inline |
|
inlinevirtual |
Implements JServoStallSensing.
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Implements JServoStallSensing.
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
the readings from the analog input
|
protected |