Experimental Purpose:
Use arduino to realize a small test of running lights, so that each small light goes on and off in sequence (the previous small light goes off while the next small light goes on) and lasts for 200ms.
Step 1: Components used, one arduino uno board, 8 led lights, 8 220Ω resistors, a number of Dupont wires, one breadboard.
Plug the bottom wire (GND) into the negative terminal of the breadboard (this step can be done anytime). Insert the led and resistor into the breadboard as shown in the picture
Wiring according to the diagram, pay attention to the correspondence between the port and the small light
Connect both negative terminals of the small lamps to the negative terminal of the breadboard.
The code used for the experiment is as follows:
1 | /*实现流水灯 |
The program runs on Tinkercad with the following results.
Enter the code and check the port.
Compile and upload to arduino boards
The overall hardware connection of the experiment is shown in Fig.
The results of the experimental runs are as follows.
Reference
https://blog.csdn.net/foolbirdM/article/details/112733676
https://www.ncnynl.com/archives/201607/355.html