keybrd library is an open source library for creating custom-keyboard firmware.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

PCA9655E_3_scan_lib.ino 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* PCA9655E_3_scan_lib.ino
  2. does same as PCA9655E_2_scan.ino, but using keybrd library classes
  3. pictures in PCA9655E_2_scan/
  4. set port 1 pins
  5. read and print value of port 0
  6. measure port 1 pin voltages with a multimeter
  7. DESTINATION PIN PIN_NUMBER PIN DESTINATION
  8. x INT 1 24 VDD Teensy LC 3.3V
  9. SCL AD1 2 23 SDA Teensy LC 18
  10. GND AD2 3 22 SCL Teensy LC 19
  11. GND IO0_0 4 21 AD0 SCL
  12. GND IO0_1 5 20 IO1_6 x
  13. IO1_1 IO0_2 6 19 IO1_5 x
  14. GND IO0_3 7 18 IO1_4 x
  15. GND IO0_4 8 17 IO1_4 x
  16. GND IO0_5 9 16 IO1_3 x
  17. x IO0_6 10 15 IO1_2 x
  18. x IO0_7 11 14 IO1_1 IO0_2 strobe pin
  19. GND VSS 12 13 IO1_0 x
  20. */
  21. #include <Port_PCA9655E.h>
  22. #include <Scanner_IOE.h>
  23. const uint8_t ADDR = 0x18; //I2C address with AD2=GND AD1=SCL AD0=SCL
  24. Port_PCA9655E port0(ADDR, 0, ~0); //read all pins
  25. Port_PCA9655E port1(ADDR, 1, 0); //for strobe
  26. Scanner_IOE scanner_R(HIGH, port1, port0);
  27. void setup()
  28. {
  29. delay(6000);
  30. Keyboard.print("PCA9655E_3_scan.ino");
  31. scanner_R.begin();
  32. Keyboard.print(" port0_val= ");
  33. uint8_t port0_val = scanner_R.scan(1<<1); //strobe pin 1
  34. Keyboard.print(port0_val, BIN); //expect xx000100
  35. }
  36. void loop() { }