OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
FakeAxis Class Reference

Fake analog input for testing. More...

#include <InputHardware.hpp>

Public Member Functions

 FakeAxis (FakeInput *instance, bool leftOrRight)
 Construct a new Fake Digital Input object.
 
void resetCalibrationData () override
 Force auto-calibration.
 
void getCalibrationData (int &minReading, int &maxReading) override
 Get auto-calibration data. Required for persistent storage.
 
void setCalibrationData (int minReading, int maxReading) override
 Set auto-calibration data (loaded from persistent storage).
 
void read (uint8_t &value, bool &autoCalibrated)
 Read current axis position. The axis must go from one end to the other for auto- calibration.
 
- Public Member Functions inherited from AnalogInput

Detailed Description

Fake analog input for testing.

Definition at line 554 of file InputHardware.hpp.

Constructor & Destructor Documentation

◆ FakeAxis()

FakeAxis::FakeAxis ( FakeInput * instance,
bool leftOrRight )
inline

Construct a new Fake Digital Input object.

Parameters
instanceFake input specification
leftOrRightTrue for the left axis, false for the right axis

Definition at line 568 of file InputHardware.hpp.

Member Function Documentation

◆ getCalibrationData()

void FakeAxis::getCalibrationData ( int & minReading,
int & maxReading )
inlineoverridevirtual

Get auto-calibration data. Required for persistent storage.

Parameters
[out]minReadingMinimum adc reading
[out]maxReadingMaximum adc reading

Implements AnalogInput.

Definition at line 579 of file InputHardware.hpp.

◆ read()

void FakeAxis::read ( uint8_t & value,
bool & autoCalibrated )
inlinevirtual

Read current axis position. The axis must go from one end to the other for auto- calibration.

Parameters
[out]valueCurrent axis position.
[out]autoCalibratedTrue if this axis has been auto-calibrated.

Implements AnalogInput.

Definition at line 587 of file InputHardware.hpp.

◆ resetCalibrationData()

void FakeAxis::resetCalibrationData ( )
inlineoverridevirtual

Force auto-calibration.

Implements AnalogInput.

Definition at line 574 of file InputHardware.hpp.

◆ setCalibrationData()

void FakeAxis::setCalibrationData ( int minReading,
int maxReading )
inlineoverridevirtual

Set auto-calibration data (loaded from persistent storage).

Parameters
[out]minReadingMinimum adc reading
[out]maxReadingMaximum adc reading

Implements AnalogInput.

Definition at line 585 of file InputHardware.hpp.


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