HCI-Lab-Saarland / MultiTouchKit

Other
46 stars 15 forks source link

Use without multiplexer on ESP32 #2

Open jwktje opened 4 years ago

jwktje commented 4 years ago

I have a breakout for the ESP32-WROVER which has enough pins to make a 5x5 grid without a multiplexer. How could I use this library with such a setup?

HCI-Lab-Saarland commented 4 years ago

Dear Jan, The library is designed and tested to work with Arduino Uno, MEGA2560, LilyPad(ATmega 328P).

jwktje commented 4 years ago

I understand. I can try to adapt it myself but what I'm mostly wondering is; Can this library be used without a multiplexer?

The MEGA2560 presumably would have enough pins without multiplexing.

HCI-Lab-Saarland commented 4 years ago

First, you should check if you can send the recommended square wave signal to several pins without multiplexer. Second, you should consider that, the internal architecture of the Arduino analog-to-digital (ADC) converter which implements a low-pass filter is also important

jwktje commented 4 years ago

Thank you again for answering so quickly.

So the advice is that (for stability and compatibility) it's better to use the CD74HC4067 Multiplexer even if the Arduino you use has enough pins?

If so, that is totally fine. I'm just looking for the best solution for my use-case.

HCI-Lab-Saarland commented 4 years ago

That's right. You can use this multiplexer or other multiplexers that work in the recommended frequency band.

jwktje commented 4 years ago

Okay! I will order a multiplexer and will test with that. Thanks for the advice.

jwktje commented 4 years ago

I've been reading through the published papers and the code here on github to try and see if I can add ESP32 compatibility to this library.

The ESP32 has PWM and it has ADC's. So it should be possible. I think I'm just not skilled enough to figure it all out by myself

When using an ESP32 and a multiplexer, could I make this library compatible if I do the following?

  1. Add a definition for the board in void MultiTouchKit::setupPWM(){
  2. Make sure Frequency and Duty cycle are set correctly here
  3. Define the timer pin as output
  4. Make sure I use PWM compatible pins as _muxPins
  5. Make sure I use ADC pins as _adcPins

I'm not fully sure yet how to do all the above. But I can maybe figure it out. I'm also willing to put up a code bounty for ESP32 compatibility

jwktje commented 4 years ago

I've created a Bountify post for this issue.

YakuIt commented 4 years ago

Hi jwktje, I'm also trying to get this great library to work for the ESP32, but I'm struggling. Did you have any luck?

jwktje commented 4 years ago

@YakuIt Yes actually. From that Bountify post I got some help from someone. They are now collaborating on a Bitbucket repo with me to try and make it work. It looks promising but isn't done yet.

The implementation will most likely not be an extension of this library, as it's quite different already. But will make something like this possible on an ESP32 based board. For now it's a work in progress so nothing to share right now.

YakuIt commented 4 years ago

That's great to hear! I hope it goes well.

yohanalexjohn commented 1 year ago

@YakuIt Yes actually. From that Bountify post I got some help from someone. They are now collaborating on a Bitbucket repo with me to try and make it work. It looks promising but isn't done yet.

Was wondering what the current status of this implementation is at