Arduino Photoresistor: Difference between revisions

From wikiluntti
Line 3: Line 3:
Simple code to use photoresistor or photocell or light-dependent resistor LDR.
Simple code to use photoresistor or photocell or light-dependent resistor LDR.


The resistance of a photoresistor decreases when it is hit by light, or it lets electricity flow through it if light is hitting it
The resistance of a photoresistor decreases when it is hit by light, or it lets electricity flow through it if light is hitting it.
 
Need to use a voltage divider.


== Code ==
== Code ==

Revision as of 18:02, 29 November 2024

Introduction

Simple code to use photoresistor or photocell or light-dependent resistor LDR.

The resistance of a photoresistor decreases when it is hit by light, or it lets electricity flow through it if light is hitting it.

Need to use a voltage divider.

Code

  • 10kohm