bài 3(thật nè)
unknown
plain_text
2 years ago
328 B
5
Indexable
#define D4 2
void setup()
{
Serial.begin(9600);
pinMode(D4, INPUT);
}
void loop()
{
int pirState = digitalRead(D4);
if (pirState == HIGH)
{
Serial.println("Chuyển động được phát hiện!");
}
else
{
Serial.println("Không có chuyển động.");
}
delay(1000);
}
Editor is loading...
Leave a Comment