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

Method begin

libraries/MCP23008/MCP23008.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35#if defined(ESP8266) || defined(ESP32)
36bool MCP23008::begin(const uint8_t dataPin, const uint8_t clockPin)
37{
38 _wire = &Wire;
39 _wire->begin(dataPin, clockPin);
40 // check connected
41 if (! isConnected()) return false;
42 // disable address increment (datasheet)
43 if (! writeReg(MCP23008_IOCR, 0b00100000)) return false;
44 // Force INPUT_PULLUP
45 if (! writeReg(MCP23008_PUR_A, 0xFF)) return false;
46 return true;
47}
48#endif
49
50

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36