rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
controllers
sensors
converters
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
11
#include "
sensor_converter_func.h
"
12
13
class
ResistanceFunc
final :
public
SensorConverter
{
14
public
:
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
21
private
:
22
float
m_supplyVoltage
= 5.0f;
23
float
m_pullupResistor
= 1000.0f;
24
bool
m_isPulldown
=
false
;
25
};
ResistanceFunc
Definition
resistance_func.h:13
ResistanceFunc::m_supplyVoltage
float m_supplyVoltage
Definition
resistance_func.h:22
ResistanceFunc::m_isPulldown
bool m_isPulldown
Definition
resistance_func.h:24
ResistanceFunc::configure
void configure(float supplyVoltage, float pullupResistor, bool isPulldown)
Definition
resistance_func.cpp:7
ResistanceFunc::m_pullupResistor
float m_pullupResistor
Definition
resistance_func.h:23
ResistanceFunc::convert
SensorResult convert(float inputValue) const override
Definition
resistance_func.cpp:13
ResistanceFunc::showInfo
void showInfo(float testInputValue) const override
Definition
sensor_info_printing.cpp:93
SensorResult
expected< float > SensorResult
Definition
sensor.h:46
sensor_converter_func.h
SensorConverter
Definition
sensor_converter_func.h:5
Generated on Sat Sep 27 2025 00:10:06 for rusEFI by
1.9.8