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

Method readSmoothed

libraries/AnalogPin/AnalogPin.cpp:53–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52
53int AnalogPin::readSmoothed()
54{
55 _rawRead();
56 if (_alpha > 0)
57 {
58 _value = _value + (_alpha * (_prevValue - _value)) / 32;
59 }
60 _prevValue = _value;
61 return _value;
62}
63
64
65void AnalogPin::_rawRead()

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64