Arduino, Cpp.
provided by the LDR // If the value read on the analog port is greater than 800, turn on the LED // Adjust the value below according to your circuit if (state > 800) { digitalWrite(ledPort, HIGH); } else { // Otherwise, turn off the LED digitalWrite(ledPort, LOW); } } Note: After entering the code