Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pir = 2;
- int led = 13;
- int value = 0;
- void setup() {
- //put your setup code here, to run once:
- pinMode (pir, INPUT);
- pinMode (led, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- //put your main code here, to run repeatedly:
- value = digitalRead(pir);
- Serial.println(value);
- if (value==1)
- {
- digitalWrite(led,HIGH);
- }
- else
- {
- digitalWrite(led,LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement