0

When I press a key on a matrix I need to send the corresponding hex value to a function. Is there any way to use a byte matrix for the keymap instead of a char one? I've tried just changing the variable type of the matrix (seen bellow) but I get all kinds of errors...

byte keys[ROWS][COLS] = {
  {0xE1, 0x05, 0x06},
  {0x07, 0x08, 0x09},
  {0x0A, 0x0B, 0x0C},
};
JanG
  • 33
  • 9
  • can't you use unsigned char? see here [link](http://stackoverflow.com/questions/75191/what-is-an-unsigned-char) – Biruk Abebe Apr 09 '16 at 15:43
  • @bkVnet yes that's possible, but how would you recommend converting an unsigned char like "0x04" to a byte (or integer)? – JanG Apr 09 '16 at 21:58
  • **unsigned char m=0x04; then int x=m;** will do a implicit type cast between unsigned char and int, if i understand your question correctly. – Biruk Abebe Apr 09 '16 at 22:07

0 Answers0