sources and files for the bombatuino project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
539 B

  1. #include <Wire.h>
  2. #include <INPUT_MCP23017.h>
  3. #include <INPUT_74HC4051.h>
  4. INPUT_MCP23017 input_MCP23017;
  5. INPUT_74HC4051 input_4051;
  6. void setup() {
  7. Serial.begin(9600);
  8. input_MCP23017.begin(0,printValue);
  9. input_4051.begin(A0,11,12,13,printValue);
  10. }
  11. void loop() {
  12. input_MCP23017.loop();
  13. input_4051.loop();
  14. }
  15. void printValue(int id, int pin, int value) {
  16. Serial.print("id: ");
  17. Serial.print(id);
  18. Serial.print(" pin: ");
  19. Serial.print(pin);
  20. Serial.print(" value: ");
  21. Serial.print(value);
  22. Serial.println();
  23. }