项目作者: 9glt

项目描述 :
check if pin state changed
高级语言: C++
项目地址: git://github.com/9glt/arduino-button.git
创建时间: 2020-07-07T15:17:03Z
项目社区:https://github.com/9glt/arduino-button

开源协议:Apache License 2.0

下载


arduino-button

check if pin state changed

example usage

  1. #include "Button.h"
  2. Button button1(7, LOW); // LOW for input pullup HIGH for INPUT
  3. Button button2(8, LOW, 1000); // 1000 - debaunce delay
  4. void setup() {
  5. Serial.begin(9600);
  6. }
  7. void loop() {
  8. if(button1.down()) {
  9. Serial.println("CLICK!");
  10. }
  11. if(button2.debounce()) {
  12. Serial.println("debounce click");
  13. }
  14. }