keybrd library is an open source library for creating custom-keyboard firmware.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

12345678910111213141516171819202122232425262728
  1. #ifndef ROWBASE_H
  2. #define ROWBASE_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <Key.h>
  6. /* RowBase is an abstract base class.
  7. Define and initilize DELAY_MICROSECONDS in sketch.
  8. const unsigned int RowBase::DELAY_MICROSECONDS = 0;
  9. */
  10. class RowBase
  11. {
  12. private:
  13. static const unsigned int DELAY_MICROSECONDS; //delay between each Row scan for debouncing
  14. Key *const *const ptrsKeys; //array of Key pointers
  15. virtual void keyWasPressed();
  16. protected:
  17. uint8_t debounced; //bitwise, 1 means pressed, 0 means released
  18. void wait();
  19. void pressRelease(const uint16_t rowEnd, const uint8_t debouncedChanged);
  20. public:
  21. RowBase(Key *const ptrsKeys[]) : ptrsKeys(ptrsKeys), debounced(0) { }
  22. virtual void process()=0;
  23. };
  24. #endif