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.

Scanner_Port.cpp 818B

1234567891011121314151617181920212223242526272829303132
  1. #include "Scanner_Port.h"
  2. /*
  3. Strobes the row and reads the columns.
  4. */
  5. uint8_t Scanner_Port::scan()
  6. {
  7. //strobe row on
  8. if (STROBE_ON == LOW) //if activeLow
  9. {
  10. refStrobePort.setActivePinLow(strobePin);
  11. }
  12. else //if activeHigh
  13. {
  14. refStrobePort.setActivePinHigh(strobePin);
  15. }
  16. delayMicroseconds(3); //time to stablize voltage
  17. //read the port pins
  18. refReadPort.read();
  19. //strobe row off
  20. if (STROBE_ON == LOW) //if activeLow
  21. {
  22. refStrobePort.setActivePinHigh(strobePin);
  23. }
  24. else //if activeHigh
  25. {
  26. refStrobePort.setActivePinLow(strobePin);
  27. }
  28. return refReadPort.getPortState();
  29. }