RCKit
|
Setter class that outputs its value to a HBridge configured on 2 output Setter. More...
#include <HBridgeSetter.h>
Public Member Functions | |
HBridgeSetter (Setter *targetA, Setter *targetB) | |
void | setTargets (Setter *targetA, Setter *targetB) |
virtual void | input (int value) |
virtual void | failsafe () |
Public Member Functions inherited from Setter | |
Setter () | |
Constructor. More... | |
Setter (Setter *target) | |
Constructor with setting the target. | |
virtual void | setTarget (Setter *target) |
void | setFailsafeValue (int failsafeValue) |
Sets the failsafeValue. | |
int | failsafeValue () |
Additional Inherited Members | |
Protected Attributes inherited from Setter | |
Setter * | _target |
This is the instance of Setter that will be given the transfotmed output value. | |
int | _failsafeValue |
Setter class that outputs its value to a HBridge configured on 2 output Setter.
A HBridge is used to drive a motor in forward and reverse directions. It requires 2 Setters as output: one to drive the motor forwards and one to drive it in reverse. When driving forward the reverse output is 0 and vice versa.
Typically the outputs would be AnalogSetters to control a motor through a pair of analog outputs, but could be ServoSetter, AccelStepperSpeedSetter or AccelStepperPositionSetter or any other combination.
|
virtual |
Called when the source of input data is lost, and the Setter is required to fail in a safe way. Calls the failsafes of targetA and targetB
Reimplemented from Setter.
References Setter::failsafe().
|
virtual |
Input the value to be used to set the 2 output Setters. Input of 127 produces 0 on both outputs (stopped) Input of 128 to 255 translates to output Setter A from 0 to 256 and output Setter B at 0 (forward). Input of 127 to 0 translates to output Setter B from 0 to 254 and output Setter A at 0 (reverse).
[in] | value | The input value to set. |
Reimplemented from Setter.
References Setter::input().
Set or change the output pin
References Setter::setTarget().