PIR Sensor

PIR Sensor

มี 13 ชิ้น

รายละเอียดอุปกรณ์

เซ็นเซอร์ตรวจจับการเคลื่อนไหว PIR (Passive Infrared) ใช้ในระบบรักษาความปลอดภัยและระบบอัตโนมัติ

วิดีโอตัวอย่าง

Technical Resources

Sample Code

int pirPin = 2;
int led = 13;

void setup() {
  pinMode(pirPin, INPUT);
  pinMode(led, OUTPUT);
  Serial.begin(9600);
  Serial.println("PIR sensor warming up...");
  delay(10000);
}

void loop() {
  int motion = digitalRead(pirPin);
  if (motion == HIGH) {
    digitalWrite(led, HIGH);
    Serial.println("Motion detected!");
  } else {
    digitalWrite(led, LOW);
  }
  delay(100);
}

แชร์โค้ดของคุณ

ต้องการแชร์โค้ดโปรเจคของคุณ? อัปโหลดโค้ดพร้อมคำอธิบายในส่วนโปรเจ็คต์ของนักเรียน

ไปที่หน้าอัปโหลดโปรเจค

โปรเจ็คต์ของนักเรียน

ดูโปรเจคที่นักเรียนสร้างด้วยอุปกรณ์นี้

ยังไม่มีโปรเจคที่ใช้อุปกรณ์นี้

แชร์โปรเจคของคุณ