Overview:
In this experiment, we use the analog port A0 of SUNFOUNDER MEGA2560 to read the resistance of photoresistor after processing by the master control chip built-in ADC module, and display it on the serial monitor.
Components:
SUNFOUNDER MEGA2560 * 1
Photoresistor * 1
Resistor (10K Ohm) * 1
USB Cable * 1
Jumper wires
Steps:
First, connect the circuit
![](https://learn.sunfounder.com/wp-content/uploads/2020/10/image-1974.png)
Second, program (Please refer to example code in CD we provide)
Third, compile the program
Fourth, burn the program into SUNFOUNDER MEGA2560 board
![](https://learn.sunfounder.com/wp-content/uploads/2020/10/image-1967.png)
![](https://learn.sunfounder.com/wp-content/uploads/2020/10/image-1976.png)