RCKit
Public Member Functions
HBridgeSetter Class Reference

Setter class that outputs its value to a HBridge configured on 2 output Setter. More...

#include <HBridgeSetter.h>

Inheritance diagram for HBridgeSetter:
Inheritance graph
[legend]
Collaboration diagram for HBridgeSetter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HBridgeSetter (Setter *targetA, Setter *targetB)
void setTargets (Setter *targetA, Setter *targetB)
virtual void input (int value)
virtual void failsafe ()

Detailed Description

Setter class that outputs its value to a HBridge configured on 2 output Setter.

Author:
Mike McCauley (mikem@open.com.au)

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.

Examples:

DifferentialRCRx.pde, HBridge2RCRx.pde, HBridgeRCRx.pde, and TestSuite.pde.


Constructor & Destructor Documentation

HBridgeSetter::HBridgeSetter ( Setter targetA,
Setter targetB 
)
Parameters:
[in]targetAThe Setter to use for output A.
[in]targetBThe Setter to use for output B.
Author:
Mike McCauley (mikem@open.com.au)

Member Function Documentation

void HBridgeSetter::failsafe ( ) [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().

void HBridgeSetter::input ( int  value) [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).

Parameters:
[in]valueThe input value to set.

Reimplemented from Setter.

References Setter::input().

void HBridgeSetter::setTargets ( Setter targetA,
Setter targetB 
)

Set or change the output pin

Parameters:
[in]targetAThe Setter to use for output A.
[in]targetBThe Setter to use for output B.

References Setter::setTarget().


The documentation for this class was generated from the following files: