Arduino KeyPad Library

Hi,

I am currently trying to use my arduino mega to read out input from an electronic dartboard.

i already identified how the matrix of the dartboard is built and connected everything to my arduino mega.

(It's a 4x20 matrix
with the 4 rows being single, double, triple and bullseye
and the 20 columns are the numbers from 1 to 20)

Now to my actual question, i wanted to (mis)use this library to get the data and it seemed to work fine at first, until i realized that the last 4 columns didnt give a response.
I tried using diffrent pins but it was always the last 4 i defined using the example from the library.

So after that i looked into the Code of the Library itself and found this line:

#define MAPSIZE 10		// MAPSIZE is the number of rows (times 16 columns)

and this line:

	uint bitMap[MAPSIZE];	// 10 row x 16 column array of bits. Except Due which has 32 columns.

in both cases in the comment it states something about 16 columns (which i guess is somehow defined as the max )
i couldnt find where this 16 comes from and how i can work around that.

so if anybody with a little more C knowledge than myself can help me out by finding where this 16 comes from and how i can increase that to 20, i would be very grateful!

Cheers

i couldnt find where this 16 comes from and how i can work around that.

How many bytes in an int? How many bits in a byte? The comment provided a HUGE clue.

You can not change the number of bits in a byte, or the number of bytes in an int.

You might be able to change the type of the array to long, and have more bits.

Thank you so much!

For some reason i was under the impression an int had 4 bytes which is not correct as i now know, but even if i knew, i wouldn't have made that connection.

Turning the uint array into a ulong aray did the trick and everything works fine now !

THX!

but even if i knew, i wouldn't have made that connection.

That's why the hint about the Due, which DOES have 32 bit int's was so important.

Turning the uint array into a ulong aray did the trick and everything works fine now !

Great.