Home » Blog » How to connect buttons to the Webradio PCB

How to connect buttons to the Webradio PCB

Published on 1 June 2020 at 17:50

Before you start using buttons I suggest you first open the web interface of the webradio and check that all functions work properly. Next, I advise you to read Edzelf's excellent manual.

Ok, let's configure those buttons.

Find the pin header with 6 pins on the left side of the board. These are the pins that you will use to connect your buttons to.

The 6 Touch pins (4, 5, 6, 7, 8, 9) map to GPIO pins 13, 12, 14, 27, 33 and 32. If you want to use them for touch buttons, with only one wire per button, put this in the config page of the web interface:

touch_04 = uppreset = 1
touch_05 = upvolume = 2
touch_06 = downvolume = 2
touch_07 = stop

This is only an example, you can use any function you want:  stop, resume, pause, etc.

Connect a Dupont wire to Touch pin 4, save the configuration and restart the webradio. Wait for the webradio to start playing.
Now, touch the loose end of the Dupont wire with your finger. If all goes well, the webradio should execute 'uppreset = 1' and switch to the next preset radio station. If it doesn't: check the spelling, connections and configuration.


If you want to use the pins for regular push buttons, with one wire to a GPIO pin and another wire to GND for each button, put this in the config page:

gpio_13 = uppreset = 1       # touch pin 4
gpio_12 = upvolume = 2      # touch pin 5
gpio_14 = downvolume = 2  # touch pin 6
gpio_27 = stop                    # touch pin 7


You can use one or more of the GND pins on the 4-pin header.

Don’t put both settings in the config page.


 »

Add comment

Comments

There are no comments yet.