rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
resistance_func.h
Go to the documentation of this file.
1/**
2 * @author Matthew Kennedy, (c) 2019
3 *
4 * A function to convert input voltage to resistance in a voltage divider.
5 * Configured with the value of the pullup resistor, and the voltage to which
6 * it's connected.
7 */
8
9#pragma once
10
12
13class ResistanceFunc final : public SensorConverter {
14public:
15 void configure(float supplyVoltage, float pullupResistor, bool isPulldown);
16
17 SensorResult convert(float inputValue) const override;
18
19 void showInfo(float testInputValue) const override;
20
21private:
22 float m_supplyVoltage = 5.0f;
23 float m_pullupResistor = 1000.0f;
24 bool m_isPulldown = false;
25};
void configure(float supplyVoltage, float pullupResistor, bool isPulldown)
SensorResult convert(float inputValue) const override
void showInfo(float testInputValue) const override
expected< float > SensorResult
Definition sensor.h:46