Overview:
In this experiment, we will use an LED to indicate the state value of PIR. When someone goes by, the LED will light up; when no one goes by, the LED will go out.
Components:
SUNFOUNDER MEGA2560 * 1
PIR * 1
USB Cable * 1
Jumper wires
Steps:
First, connect the circuit
The connection between SUNFOUNDER MEGA2560 and the LED is shown below:
Second, program (Please refer to example code in CD we provide)
Third, compile the program
Fourth, burn the program into SUNFOUNDER MEGA2560 board