GY-63_MS5611/libraries/MCP23008/examples/MCP23008_digitalRead/MCP23008_digitalRead.ino
2022-01-10 12:51:36 +01:00

41 lines
597 B
C++

//
// FILE: MCP23008_digitalRead.ino
// AUTHOR: Rob Tillaart
// DATE: 2019-10-14
// PUPROSE: test MCP23008 library
#include "MCP23008.h"
#include "Wire.h"
MCP23008 MCP(0x27);
void setup()
{
Serial.begin(230400);
Serial.print("MCP23008_test version: ");
Serial.println(MCP23008_LIB_VERSION);
Wire.begin();
MCP.begin();
MCP.pinMode8(0x00);
Serial.println("TEST digitalRead(pin)");
for (int pin = 0; pin < 8; pin++)
{
int val = MCP.digitalRead(pin);
Serial.print(val);
Serial.print('\t');
}
Serial.println();
}
void loop()
{
}
// -- END OF FILE --