- Const Int Ledpin 13 Const Int Busserpin 12 Const Int Ldrpin A0 Void Setup Pinmode Ledpin Output Pinmode 1 (11.66 KiB) Viewed 28 times
const int ledPin = 13; const int busserPin = 12; const int ldrPin = A0; void setup() { pinMode(ledPin, OUTPUT); pinMode
-
- 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
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);