bombatuino/source/INPUT_MCP23017_test/INPUT_MCP23017_test.ino

31 lines
619 B
Arduino
Raw Normal View History

2013-02-14 02:59:15 +01:00
#include <Wire.h>
2013-03-12 14:53:27 +01:00
#include <bombatuino_INPUT_MCP23017.h>
#include <bombatuino_INPUT_74HC4051.h>
#include <bombatuino_ROTARY_ENCODER.h>
2013-02-14 02:59:15 +01:00
INPUT_MCP23017 input_MCP23017;
INPUT_74HC4051 input_4051;
void setup() {
2013-05-14 08:28:05 +02:00
Serial.begin(9600);
input_MCP23017.begin(0,printData);
input_4051.begin(A3,10,11,12,printData);
2013-02-14 02:59:15 +01:00
}
void loop() {
input_MCP23017.loop();
input_4051.loop();
}
2013-05-14 08:28:05 +02:00
void printData(int id, int pin, int value) {
Serial.print("id");
Serial.print(id);
Serial.print(" - ");
Serial.print("pin");
Serial.print(pin);
Serial.print(" : ");
Serial.print(value);
Serial.println();
2013-02-14 02:59:15 +01:00
}