Photoresistor Module

$4.85

19 in stock

Description

Photoresistor Code


/* SETUP

Photoresistor  Arduino
S       -      A5
        -      5V
-       -      GND
*/
 
int sensorPin = A5; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  sensorValue = analogRead(sensorPin);
  digitalWrite(ledPin, HIGH);
  delay(sensorValue);
  digitalWrite(ledPin, LOW);
  delay(sensorValue);
  Serial.println(sensorValue, DEC);
}

 

Additional information

Weight 0.002 kg

There are no reviews yet.

Be the first to review “Photoresistor Module”

Your email address will not be published.