Chat freely about anything...

User avatar
By batstru
#75855 Hi all,

I have a guitar hero wireless controller, but it's for the wiiU: since I can't connect to anything else but this console, I decided to replace the hardware to make it working with linux.

Since the electronic of the guitar is pretty basic (just a lot of buttons), I decided to use an esp8266 to read inputs and to send commands to a computer.

I thought it would have been easier to read an input from a button... but so far I was not able to make it.
I'm following this: https://www.arduino.cc/en/Tutorial/Button

- Do you have any documentation or working example? The one I'm referring to don't work for me. I'm using an esp01.
- I read about debouncing. is it required?
- how can I read input from multiple buttons pressed at the same time? I should be able to connect multiple buttons to one input.. but what if inputs from multiple buttons come together?

Thanks for your answers.
User avatar
By rudy
#75862
how can I read input from multiple buttons pressed at the same time? I should be able to connect multiple buttons to one input.


DS2408 - 1-Wire 8-Channel Addressable Switch
8-Channel, Bidirectional Port Expander can be Powered and Operated from a Single Communication Line

You can have multiple DS2408 connected to a single ESP port pin. Eight switches per DS2408. Read each switch.
User avatar
By btidey
#75863 The simple way to read multiple buttons is to connect each to its own GPIO input.

So the first part of the answer is don't use a ESP-01 with its very limited GPIO.

Modules based on the ESP-12 allow up to about 9 (or 11 if you re-use TX/RX).

If you have more buttons than this then you can multiplex the reading of switches by using say 5 column outputs and 5 inputs to support up to 25 buttons. If multiple buttons can be pressed together then this also needs diodes to achieve this.

There is also a technique called charlieplexing which exploits being able to turn a GPIO into input or output to reduce the number of GPIOs for a given number of switches. It still needs the diodes.

It is a good idea to debounce the switches which can be done in software quite easily.