MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / getPercentage

Method getPercentage

libraries/AD56X8/AD56X8.cpp:126–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124
125
126float AD56X8::getPercentage(uint8_t channel)
127{
128 float value = getValue(channel);
129 if (value > 0)
130 {
131 if (_type == 16) return value * ( 1.0 / 655.35);
132 if (_type == 14) return value * ( 1.0 / 163.83);
133 if (_type == 12) return value * ( 1.0 / 40.95);
134 }
135 return 0;
136}
137
138
139bool AD56X8::prepareChannel(uint8_t channel, uint16_t value)

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36