FOTORRESISTOR
馃懗FOTORRESISTOR馃悁
Este trabajo trata de un fotorresistor que al detectar cierta cantidad de luz hace que se encienda o se apague un led que tambi茅n esta conectado.
C贸digo utilizado:
void setup()
{
Serial.begin(9600);
pinMode(8, OUTPUT);
}
void loop()
{
int luz = analogRead(A0);
Serial.println(luz);
if(luz<300){
digitalWrite(8 , HIGH);
}
else{
digitalWrite(8 , LOW);
}
}
VIDEOS E IMAGENES:
Comentarios
Publicar un comentario