Freelancer: majanubhai
Chia sẻ:
Báo cáo bài thi

code for circuit

This code turns on the red LED first, then the green, then the blue. Each LED is on for 3 seconds at a time. In the first block of code we describe the connections of the anode pins of the LEDs to the arduino board. The red LED anode is connected to digital pin 2, the green to digital pin 4, and the blue to digital pin 7. We then declare all the LEDs as outputs. They're not inputs into the arduino board but outputs. We then have our loop() function, which is the main loop that loops over and over and over again. In this code, we set it up so that the red LED is drawn HIGH first for 3 seconds. We do this with the digitalWrite() function putting it HIGH, turning the LED on. We then use the delay() function with 3000 as the value to delay 3000 milliseconds, which is 3 seconds. We then turn in the red LED with the digitalWrite() function with the parameter LOW. We then do the same for green and the blue LEDs. After this, the function loops over turning the red LED again on. This continu

                                                                                                                        Bài tham dự cuộc thi #                                            1
                                         cho                                             Small Arduino and NRF24L01 project
Bài tham dự #1

Bảng thông báo công khai

Chưa có tin nhắn nào.