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

Method event

libraries/AnalogKeypad/AnalogKeypad.cpp:30–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30uint8_t AnalogKeypad::event()
31{
32 int rv = NOKEY;
33 uint8_t _key = _rawRead();
34
35 if (_key == 0 && _lastKey == 0) rv = NOKEY;
36 else if (_key != 0 && _lastKey == 0) rv = PRESSED;
37 else if (_key == 0 && _lastKey != 0) rv = RELEASED;
38 else if (_key != 0 && _lastKey != 0 && _key == _lastKey) rv = REPEATED;
39 else if (_key != 0 && _lastKey != 0 && _key != _lastKey) rv = CHANGED;
40
41 _lastKey = _key;
42
43 return rv;
44}
45
46
47uint8_t AnalogKeypad::pressed()

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64