diff options
| author | Abel Tim <abel@main.home> | 2024-06-10 17:22:59 +0200 |
|---|---|---|
| committer | Abel Tim <abel@main.home> | 2024-06-10 17:22:59 +0200 |
| commit | e3a8cef1459cf3f48992ec704990f607d6add2c0 (patch) | |
| tree | b55d51efbd153665bec190401b950d31b69f1078 /MCP23017/with_lib/with_lib.ino | |
| parent | 5654c9d1ae286690214a726586fe8ef605d0708b (diff) | |
| download | robotica-e3a8cef1459cf3f48992ec704990f607d6add2c0.tar.gz robotica-e3a8cef1459cf3f48992ec704990f607d6add2c0.zip | |
i2c
Diffstat (limited to 'MCP23017/with_lib/with_lib.ino')
| -rw-r--r-- | MCP23017/with_lib/with_lib.ino | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/MCP23017/with_lib/with_lib.ino b/MCP23017/with_lib/with_lib.ino deleted file mode 100644 index 98d36b8..0000000 --- a/MCP23017/with_lib/with_lib.ino +++ /dev/null @@ -1,26 +0,0 @@ -/** Inputs.ino - * Sets port 7 on bank B to INPUT_PULLUP and copies its - * state to the built-in LED on the board - * https://github.com/ndomx/MCP23017-Arduino-Library - */ - -#include <mcp23017.h> - -#define MCP_ADDR (0) - -MCP23017 mcp(MCP_ADDR); - -void setup(void){ - Serial.begin(9600); - pinMode(LED_BUILTIN, OUTPUT); - - mcp.start(); - mcp.pinMode(GPB7, INPUT_PULLUP); -} - -void loop(void){ - byte mcp_input = mcp.digitalRead(GPB7); - digitalWrite(LED_BUILTIN, mcp_input); - Serial.println(mcp_input); - delay(500); -} |
