Page 1 of 1

const int ledPin = 13; const int busserPin = 12; const int ldrPin = A0; void setup() { pinMode(ledPin, OUTPUT); pinMode

Posted: Sun Jul 03, 2022 9:58 am
by answerhappygod
Const Int Ledpin 13 Const Int Busserpin 12 Const Int Ldrpin A0 Void Setup Pinmode Ledpin Output Pinmode 1
Const Int Ledpin 13 Const Int Busserpin 12 Const Int Ldrpin A0 Void Setup Pinmode Ledpin Output Pinmode 1 (11.66 KiB) Viewed 30 times
const int ledPin = 13; const int busserPin = 12; const int ldrPin = A0; void setup() { pinMode(ledPin, OUTPUT); pinMode (busserPin, OUTPUT); pinMode (1drPin, INPUT); } void loop() { } int IdrStatus = analogRead (1drPin); //read the state of the LDR value if (ldrStatus >= 400) { tone (busserPin, 100); digitalWrite(ledPin, HIGH); } delay(100); noTone (busserPin); digitalWrite(ledPin, LOW); delay(100); } else { noTone (busserPin); digitalWrite(ledPin, LOW);