Help required with Capacitive Touch Keypad 3x3

Attracted by the cheap price and the promise of sample code I bought a Touch Shield For Arduino UNO R3 MEGA 2560 R3 Capacitive Touchpad 9 keypad 3x3 from here

I managed to find a similar product here

The only immediately obvious difference being my board does not have the 3 extra pins to extend the number of inputs from 9 to 12.

I have attached the example code for the sparkfun board below. When I attach my board and run the code it displays the "Ready … " message (Line 40) but the interrupt pin (pin 2) does go LOW when a key is pressed. The code is set up to create an interrupt to do this (line 37). As a result the getNumber() function is not called (line 48) By manually forcing pin 2 to go LOW I can get the program to enter the getNumber() routine but obviously it wont detect a key press.

Has anyone got this shield to work or can you suggest what else I can try to find out how my board might differ from the sparkfun shield so I can amend the code accordingly.

I am new to Arduino but willing to learn.

// Match key inputs with electrode numbers
    #define ONE 8
    #define TWO 5
    #define THREE 2
    #define FOUR 7
    #define FIVE 4
    #define SIX 1
    #define SEVEN 6
    #define EIGHT 3
    #define NINE 0
 
    //extras (not connected to button)
    #define ELE9 9
    #define ELE10 10
    #define ELE11 11
 
    //interupt pin
    int irqPin = 2;  // D2
 
void setup()
    {
      //make sure the interrupt pin is an input and pulled high
      pinMode(irqPin, INPUT);
      digitalWrite(irqPin, HIGH);
 
      //configure serial out
      Serial.begin(9600);
 
      // initalize I2C bus. Wiring lib not used. 
      i2cInit();
 
      // initialize mpr121
      mpr121QuickConfig();
 
      // Create and interrupt to trigger when a button
      // is hit, the IRQ pin goes low, and the function getNumber is run. 
      attachInterrupt(0,getNumber,LOW);
 
      // prints 'Ready...' when you can start hitting numbers
      Serial.println("Ready...");
    }
 
void loop()
{
  //You can put additional code here. The interrupt will run in the backgound. 
}
 
void getNumber()
{
  int touchNumber = 0;
  uint16_t touchstatus;
  char digits;
 
  touchstatus = getTouchStatus();
 
  for (int j=0; j<12; j++)  // Check how many electrodes were pressed
  {
    if ((touchstatus & (1<<j)))
      touchNumber++;
  }
 
  if (touchNumber == 1)
  {
    if (touchstatus & (1<<SEVEN))
    {
      digits = '7';
    }
    else if (touchstatus & (1<<FOUR))
    {
      digits = '4';
    }
    else if (touchstatus & (1<<ONE))
    {
      digits = '1';
    }
    else if (touchstatus & (1<<EIGHT))
    {
      digits = '8';
    }
    else if (touchstatus & (1<<FIVE))
    {
      digits = '5';
    }
    else if (touchstatus & (1<<TWO))
    {
      digits = '2';
    }
    else if (touchstatus & (1<<NINE))
    {
      digits = '9';
    }
    else if (touchstatus & (1<<SIX))
    {
      digits = '6';
    }
    else if (touchstatus & (1<<THREE))
    {
      digits = '3';
    }
    Serial.println(digits);
  }
  //do nothing if more than one button is pressed, or if all are released
  else if (touchNumber == 0)
    ;
  else
    ;
}

Did you check that your shield uses the same chip (MPR121)? Just because the features are more or less the same doesn't have to mean that the hardware is identical.

At least from what I can identify on the pictures the chip on your board connects to pins 10, 11, 12 and 13 (seems to be SPI, although then the compatibility with Mega2560 is not given) and not to the I2C pins as the Sparkfun board does.

Unfortunately the chip is not labelled! It is square and has 32 pins.

You are correct - pins 10-13 are connected to the chip. I will look up spi to see if I can work out what is happening.

Any other advice?

Thanks

I will look up spi to see if I can work out what is happening.

What exactly do you want to lookup there?

Did you get a software library as advertised? If yes, please post it, maybe there is a hint in it what chip is used. Otherwise I suggest to buy the sparkfun product, they provide information for it. Without a documentation of the chip you won't get that running.

Sorry for not being very clear! I meant I would try to learn some more about spi. I have heard about it but never had reason to use it as I am new to Arduino.

I am a bit cross about the software library. I was expecting to get it with the touch shield but it didn't arrive. I even sent a follow up email to request it but was told I would have to find it on the internet! Not very helpful!

As you say, there seems to be lots of documentation about the Sparkfun keyboard, but I haven't come across anything for mine. If I find out any thing I will post it here.

Thanks for your interest.

I am a bit cross about the software library. I was expecting to get it with the touch shield but it didn't arrive. I even sent a follow up email to request it but was told I would have to find it on the internet! Not very helpful!

If you get answer from them, ask what chip they used. Without that information you cannot get the library from the Internet because you don't know what to search for.

Have you ever solved this problem? Because I bought the same shield and now I have the same problem.