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

Method read

libraries/PIR/PIR.cpp:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38
39uint8_t PIR::read()
40{
41 if (_count == 0) return 0;
42 uint8_t rv = 0x00;
43 int i = _count -1;
44 uint8_t mask = 1 << i;
45 for (; i >= 0; i--)
46 {
47 if (digitalRead(_pins[i]) == HIGH)
48 {
49 rv |= mask;
50 }
51 mask >>= 1;
52 }
53 _lastValue = rv;
54 return rv;
55}
56
57
58uint8_t PIR::changed()

Callers 8

getChannelMaskMethod · 0.45
unittestFunction · 0.45
readBytesMethod · 0.45
readDataMethod · 0.45
readHeadingMethod · 0.45
readCmdMethod · 0.45
readRegisterMethod · 0.45
_readRegisterMethod · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36