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.

Row_ShiftRegisters.cpp 611B

123456789101112131415161718192021
  1. #include "Row_ShiftRegisters.h"
  2. /* Call begin() once in sketch setup()
  3. */
  4. void Row_ShiftRegisters::begin()
  5. {
  6. scanner.begin();
  7. }
  8. /* process() scans the row and calls any newly pressed or released keys.
  9. Bitwise variables are 1 bit per key.
  10. */
  11. void Row_ShiftRegisters::process()
  12. {
  13. read_pins_t readState; //bitwise, 1 means key is pressed, 0 means released
  14. read_pins_t debouncedChanged; //bitwise, 1 means debounced changed
  15. readState = scanner.scan();
  16. debouncedChanged = debouncer.debounce(readState, debounced);
  17. send(readPinCount, debouncedChanged);
  18. }