//Read the value of a light sensor int pinLDR=A0; int val=0; void setup() { //initialize communication at 9600 bits per second Serial.begin(9600); } void loop() { val= analogRead(pinLDR); //print the value on the serial monitor //Go to Tools->Serial Monitor to see the values Serial.println(val); delay(100); }
//turn on/off an LED using the light sensor int pinLDR=A0; int pinled=10; int val=0; void setup(){ pinMode(pinled,OUTPUT); } void loop(){ val = analogRead(pinLDR); if (val
sir sherwin gwapo
//Read the value of a light sensor
int pinLDR=A0;
int val=0;
void setup()
{
//initialize communication at 9600 bits per second
Serial.begin(9600);
}
void loop() {
val= analogRead(pinLDR);
//print the value on the serial monitor
//Go to Tools->Serial Monitor to see the values
Serial.println(val);
delay(100);
}
//turn on/off an LED using the light sensor
int pinLDR=A0;
int pinled=10;
int val=0;
void setup(){
pinMode(pinled,OUTPUT);
}
void loop(){
val = analogRead(pinLDR);
if (val