keybrd library is an open source library for creating custom-keyboard firmware.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

Debouncer_4Samples.h 653B

123456789101112131415161718192021
  1. #ifndef DEBOUNCER_4SAMPLES_H
  2. #define DEBOUNCER_4SAMPLES_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <config_keybrd.h>
  6. #include <DebouncerInterface.h>
  7. /* Debouncer_4Samples
  8. Configuration: #define SAMPLE_COUNT in config_keybrd.h
  9. */
  10. class Debouncer_4Samples : public DebouncerInterface
  11. {
  12. private:
  13. read_pins_t samples[SAMPLE_COUNT]; //bitwise, one bit per key, most recent readings
  14. uint8_t samplesIndex; //samples[] current write index
  15. public:
  16. Debouncer_4Samples(): samplesIndex(0) {}
  17. virtual read_pins_t debounce(const read_pins_t rawSignal, read_pins_t& debounced);
  18. };
  19. #endif