arduino light test

This commit is contained in:
sam
2023-09-06 16:31:52 +02:00
parent 6176d8d224
commit f366f9f9c0

View File

@@ -0,0 +1,20 @@
/*
* Created by ArduinoGetStarted.com
*
* This example code is in the public domain
*
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-light-sensor
*/
#define LDR 5
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
// reads the input on analog pin A0 (value between 0 and 1023)
int analogValue = analogRead(LDR);
Serial.println("Analog reading: ");
Serial.println(analogValue); // the raw analog reading
}