Arduino example for mini PIR motion sensor from Banggood

preview_player
Показать описание
Link to buy:

The code:

int LED = 13; // define PIN for LED - Biultin LED is on PIN 13
int PIR = 2; // define PIN for PIR motion sensor - PIN D2

void setup() {
pinMode(LED,OUTPUT); // define LED pin as output
pinMode(PIR,INPUT); // define PIR pin as input
}

void loop() {
digitalWrite(LED,digitalRead(PIR)); // Write value of PIR sensor to LED
}
Рекомендации по теме
Комментарии
Автор

This is gotten me most of the way :) Trying to use this to wake my monitor. Is that possible? Great job on the project!! Very grateful! Thank you.

TheCowboysdude
Автор

What is the Sensitivity of this sensor? Did you try it? 5 meters ? 10 meters? ....

WagnerCecatoMavigno
Автор

So... ?
Where is the code?
I need to make sounds when a door is opened.
Can anyone help with this please???

eyalitmanager
Автор

Could some one paste code here for easier access

error
Автор

I love your video man!!! GREAT JOB... I started to make some arduino videos, could you come check it out and tell me what you think... thanks

riseoftechk