43 lines
638 B
Arduino
Raw Normal View History

2021-01-29 12:31:58 +01:00
//
2022-01-09 20:53:12 +01:00
// FILE: MCP23017_digitalRead.ino
2021-01-29 12:31:58 +01:00
// AUTHOR: Rob Tillaart
// DATE: 2019-10-14
// PUPROSE: test MCP23017 library
#include "MCP23017.h"
#include "Wire.h"
MCP23017 MCP(0x38);
void setup()
{
Serial.begin(230400);
Serial.print("MCP23017_test version: ");
Serial.println(MCP23017_LIB_VERSION);
2021-12-21 17:12:20 +01:00
2021-01-29 12:31:58 +01:00
Wire.begin();
MCP.begin();
MCP.pinMode8(0, 0x00); // CHECK
MCP.pinMode8(1, 0x00);
2021-12-21 17:12:20 +01:00
2021-01-29 12:31:58 +01:00
Serial.println("TEST digitalRead(pin)");
for (int pin = 0; pin < 16; pin++)
{
int val = MCP.digitalRead(pin);
Serial.print(val);
Serial.print('\t');
}
2021-12-21 17:12:20 +01:00
Serial.println();
2021-01-29 12:31:58 +01:00
}
void loop()
{
}
2021-12-21 17:12:20 +01:00
// -- END OF FILE --
2021-01-29 12:31:58 +01:00