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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 29 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);
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply