In the last step, we added in a knob to control your internet radio volume. Now, let's add a switch so you can turn your radio on and off.
The code for the power switch is just watching digital pin 4 and if sees line voltage, it turns on, and if it goes to ground it turns off. Unplug your radio and wire the switch up like this:
Power up your radio and flip the switch to the power side to turn it on. Try flipping the switch once the radio starts playing to see if it shuts off.
Text editor powered by tinymce.