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_Not.cpp 518B

12345678910111213141516
  1. #include "Debouncer_Not.h"
  2. /* debounce() sets debounced and returns debouncedChanged.
  3. All parameters and variables are bit patterns.
  4. For parameters, 1 means pressed, 0 means released.
  5. For return, 1 means debounced changed.
  6. */
  7. read_pins_t Debouncer_Not::debounce(const read_pins_t rawSignal, read_pins_t& debounced)
  8. {
  9. read_pins_t previousDebounced; //bits, 1 means pressed, 0 means released
  10. previousDebounced = debounced;
  11. debounced = rawSignal;
  12. return debounced xor previousDebounced;
  13. }