Synchronize LED and Speaker
Step 1 - Build the Project
This code takes two outputs that use different commands and places them side-by-side to make their effect occur at the same time.
Step 2 - Upload the Code
Step 3 - Read the Walkthrough
The code is read through from top to bottom and the different commands don’t interfere with each other, so this code is similar to turning two LEDs on at once with a few syntax differences.
After both of the pins are set as OUTPUTs, they are ready to receive power to control their output. Next, you command each output individually. After the one second delay, use each output’s command to turn off each component using noTone and digitalWrite. Wait one second and start through the code again!