lostInSpace/light/light.ino
2023-02-14 21:16:47 +00:00

21 lines
397 B
C++

int sensorPin = A0;
int LED = 13;
int sensorValue = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LED,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
sensorValue = analogRead(sensorPin);
digitalWrite(LED, HIGH);
delay(sensorValue);
digitalWrite(LED,LOW);
delay(sensorValue);
Serial.println(sensorValue);
}