How can i read the hexadecimal value when a button is pressed using arduino board?

How can i read the hexadecimal value when a button is pressed using arduino board?

The Arduino does not have any buttons. It has a reset switch. There isn't much point in reading that, since it resets the Arduino.

So, I have to wonder what buttons you are talking about, and why you think that a button generates a hexadecimal value that is other than 0 or 1. The digitalRead() function tells you that.

In hex, the switch output values would be 0x00 and 0x01

But I use a 32-bit Arduino. My hex values are 0x00000000 and 0x00000001

There is no such thing as a hexadecimal value. The number 7 is simply the number 7. It isn’t hex, or binary, or anything else - it’s 7. When you print it out as text, you need some sort of textual representation. That text might be hex, decimal, roman numerals, sumerian petroglyphs or whatever. But the value is simply seven.

There is no such thing as a hexadecimal value.

If "7" is 7, what is 0x0A?

0x Decimal
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
a 10
b 11
c 12
d 13
e 14
f 15

10 16

@Crossroads: I know what 0x0A is, but I'm wondering what PaulMurrayCbr thinks it is.

You both have enough posts that there should be no confusion over what 0x0A is.

But I use a 32-bit Arduino. My hex values are 0x00000000 and 0x00000001

No, they are not. Leading zeros are meaningless.