|
|||||||
![]() |
Forum Index > General > Ask an Evil Mad Scientist! | ||
Hexadecimal calculations in Arduino IDE |
|||
| | | Printable Version |
|
Leviathan34 | ||||||||
|
Hey Windell I was wondering how to do hexadecimal calculations in the Arduino IDE (if it's even possible). |
![]() Henchperson ![]() Status: offline
Registered: 11/15/09 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
Yes, you can use hexadecimal representations of any number in C. See, for example: http://arduino.cc/en/Reference/IntegerConstants Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Leviathan34 | ||||||||
|
Thanks. |
![]() Henchperson ![]() Status: offline
Registered: 11/15/09 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
There's no difference to the compiler whether you speak decimal or hexadecimal-- both are foreign languages. It speaks binary. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Leviathan34 | ||||||||
|
Okay, now would I be correct in saying that you can only store hexadecimal in a byte variable? |
![]() Henchperson ![]() Status: offline
Registered: 11/15/09 |
||||||||
|
|||||||||
|
karlgg | ||||||||
|
Hexadecimal is like decimal, it's just a different representation of numbers... It just happens to "fit" with binary better, as 16 is a power of 2 (which also makes it easier to visualize the individual bits, once you're familiar with it). There's no "size limit" to hexadecimal, any more than there is a limit to decimal. I think I am, therefore I am... I think |
![]() Mad Scientist ![]() Status: offline
Registered: 01/25/09 |
||||||||
|
|||||||||
|
|
| All times are PDT. The time is now 12:22 PM. |
|
|
Octolively
Interactive LED kits
Meggy Jr RGB
LED matrix game
development kit.
Business-card sized
AVR target boards
Peggy 2
LED Pegboard kits