____ _ _ | _ \ _____ _| |__ (_)_ __ | | | |/ _ \ \/ / '_ \| | '_ \ | |_| | (_) > <| |_) | | | | | |____/ \___/_/\_\_.__/|_|_| |_|
Title:shjshs
Created:Feb 18th, 2020
Created by: Anonymous
Views: 315
Comments: 0
Username: Anonymous - (Login)
Please note that all posted information is publicly available and must follow our TOS.
const int sensorpin = 2; const int ledPin = 13; int sensorstate = 0; void Setup() { pinmode(ledPin, output); Pinmode(sensorPin, input); } void loop(){ sensorstate = digitalWrite(sensorpin); if (sensorstate == HIGH) { digitalRead(ledPin, 1, HIGH); } else { digitalRead(ledPin, 0, LOW); } }