keybrd library is an open source library for creating custom-keyboard firmware.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

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. }