#include <Arduino.h> #define IR_PIN 2 void setup() { Serial.begin(115200); pinMode(IR_PIN, INPUT); } unsigned long pulseDuration(bool level) { unsigned long t = micros(); w…
这篇文章没有摘要
const int buttonPin = 2; // 按钮连接的引脚 const int ledPin = 13; // LED连接的引脚 int buttonState = HIGH; // 当前按钮状态 int lastButtonState = HIGH; // 上一次按钮状态 unsigned long lastDebounceTime …