micro-ELC
Public Member Functions | Public Attributes | Protected Attributes | List of all members
LoadAdjustCoarseFine Class Reference

combines a LoadAdjust that has discrete steps with another LoadAdjust to get more precision More...

#include <LoadAdjustCoarseFine.h>

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

Public Member Functions

 LoadAdjustCoarseFine (LoadAdjust &_coarse, LoadAdjust &_fine, uint8_t _numCoarseSteps, float _maxResistance, float _fineResistance)
 combines a LoadAdjust that has discrete steps with another LoadAdjust to get more precision More...
 
void setLoad (float load)
 set a new value for the adjustable load More...
 
void begin ()
 set up pin states More...
 
virtual void setLoad (float load)=0
 set a new value for the adjustable load More...
 
virtual void begin ()=0
 set up pin states More...
 

Public Attributes

LoadAdjustcoarse
 
LoadAdjustfine
 

Protected Attributes

uint16_t numCoarseSteps
 
float maxResistance
 
float fineResistance
 
uint16_t relayValue = 0
 
float relayStepsInFine
 

Detailed Description

combines a LoadAdjust that has discrete steps with another LoadAdjust to get more precision

Constructor & Destructor Documentation

◆ LoadAdjustCoarseFine()

LoadAdjustCoarseFine::LoadAdjustCoarseFine ( LoadAdjust _coarse,
LoadAdjust _fine,
uint8_t  _numCoarseSteps,
float  _maxResistance,
float  _fineResistance 
)
inline

combines a LoadAdjust that has discrete steps with another LoadAdjust to get more precision

Parameters
_coarsereference to LoadAdjust object that has discrete steps (the coarse adjust)
_finereference to LoadAdjust object that can be used for a fine adjust
_numCoarseStepsnumber of discrete steps the coarse adjust can make (two relays can make 4 different combos)
_maxResistancemax resistance / lowest load, the value of the first step
_fineResistancemax resistance of fine adjust, used to find how many coarse steps the fine adjust can cover, can be any value, but ideally causes a few coarse steps worth of load

Member Function Documentation

◆ begin()

void LoadAdjustCoarseFine::begin ( )
inlinevirtual

set up pin states

Implements LoadAdjust.

◆ setLoad()

void LoadAdjustCoarseFine::setLoad ( float  load)
inlinevirtual

set a new value for the adjustable load

Parameters
loadbetween 0.0 and 1.0 where 1.0 is the highest load

Implements LoadAdjust.

Member Data Documentation

◆ coarse

LoadAdjust& LoadAdjustCoarseFine::coarse

◆ fine

LoadAdjust& LoadAdjustCoarseFine::fine

◆ fineResistance

float LoadAdjustCoarseFine::fineResistance
protected

◆ maxResistance

float LoadAdjustCoarseFine::maxResistance
protected

◆ numCoarseSteps

uint16_t LoadAdjustCoarseFine::numCoarseSteps
protected

◆ relayStepsInFine

float LoadAdjustCoarseFine::relayStepsInFine
protected

◆ relayValue

uint16_t LoadAdjustCoarseFine::relayValue = 0
protected

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