View previous topic :: View next topic |
Author |
Message |
matheuslps
Joined: 29 Sep 2010 Posts: 73 Location: Brazil
|
[SOLVED]Convert hex from kbd.c to int |
Posted: Sat Feb 08, 2014 7:52 pm |
|
|
I am using the kbc.c driver.
But it returns hex codes, like 0x35 = '5'.
How to make that return an int?
thanks.
Last edited by matheuslps on Sun Feb 09, 2014 6:36 am; edited 1 time in total |
|
 |
amelia
Joined: 26 Nov 2007 Posts: 2
|
|
Posted: Sun Feb 09, 2014 5:36 am |
|
|
Simply: return - '0'; 0x35 - 0x30 = 5
amelia |
|
 |
matheuslps
Joined: 29 Sep 2010 Posts: 73 Location: Brazil
|
|
Posted: Sun Feb 09, 2014 6:35 am |
|
|
amelia!!
Thanks. That worked!!!! So easy and I could not imagine that.
SOLVED! |
|
 |
|