- #define PIN_NUM 2
- void setup() {
- Serial.begin(9600);
- pinMode(PIN_NUM,INPUT);
- }
- void loop() {
- if(digitalRead(PIN_NUM)==HIGH){
- Serial.println("Someone here!");
- }
- else {
- Serial.println("Nobody");
- }
- delay(1000);
- }
-
Arduino-----人体传感器
最新推荐文章于 2024-09-07 19:01:50 发布