First commit
This commit is contained in:
20
light/light.ino
Normal file
20
light/light.ino
Normal file
@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user