This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCA8418: TCA8418 interfacing Programming

Part Number: TCA8418

Hi,

I am designed a custom PCB and I am facing a very small issue related to program if someone can help me with it. It is Arduino Code. I know it is out of your jurisdiction but I think someone can help me with it because I also found Arduino code example in other thread provided by TI guy.

I have a keypad as shown in below picture.



I am getting some different number on each key press . I don't mind if i can get a unique number of each key. The rest i can mange.
I received number like that
21 to 30 for SW1 to SW10
11 to 20 for SW11 to SW20
For SW21 to SW29 , I received pair number.
For example
SW21 >> 1 & 2
SW22 >> 2 & 3
SW23 >> 3 & 4
.
.
SW29 >> 9 & 10
SW30 >> 10 only.

I have two request if you can help me with it.

  1. Assign number in same sequence for SW1 to SW10 as for SW11 to SW20. For example, instead of 21 to SW1, it should be 1 for SW1. The sequence of SW11 to SW20 is perfect.
  2. Assign a single unique number from SW21 to SW30 instead of double number

Serial Monitor DATA

21,22,23,23,23,24,25,26,27,27,28,29,30
11,12,13,14,15,16,17,18,19,20
1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10

 

sketch_Aug7.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
* TCA8418 Driver
* This code is adapted from the phishman's driver for arduino, https://github.com/phishman/TCA8418
* The difference is that it is written to be easily ported to another microcontroller
* Author: Henry Troutman
*/
/*
* Keyboard PCB Hookup Guide:
* 1 -> 3.3V
* 2 -> GND
* 3 -> SDA
* 4 -> SCL
* 5 -> INT_PIN
* 6 -> RTC_INT (ds3231)
*/
// Arduino I2C Library
#include <Wire.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX