hexidecimal decimal help really needed
science_geek
Posts: 247
ok, so i bought this display, but its not here yet, and by the looks of it, it can only send out hexidecimal, i was wondering if the bs2 could read hexidecimal, if any one has a uoled display from 4d systems please let me know, i bought one but its not here yet and am not expecting it to come till the day before the competition im in,· if it can read hexidecimal, is there a way to convert it to decimal or can someone tell me the math to do it any help is greatly appreciated
Comments
I don't think any of 4D Systems' displays produce hexadecimal. They (4D Systems) may write down numbers in hexadecimal format on paper to make it easier to explain what's going on, but the numbers are all in binary.
In any event, the BS2 has what are called "formatters" in the SERIN and SEROUT statements (and DEBUG statements) that convert a binary value for output to a string of characters in binary, decimal, or hexadecimal format for display purposes and back the other way (from a string of characters in binary, decimal, or hexadecimal format) to binary for internal use by the program. Look at the appendix in the Basic Stamp Manual and the chapters on the SERIN and SEROUT statements for details.
and i got the µOLED-32028-PMD3T
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
The answer your looking for is yes. But it doesn't really matter everything is handled in Binary, you'll just have make sure you convert it to hexadecimal To make sense out of it. What I'm trying to say is every Micro Controller works in binary. So when you use hex in your program its still a Bin number just changed to a different format so you can understand it. so when you send out a hex number it is transmitted in Bin, and when you receive it it will be in bin format, and can be formated in to Dec, Hex or left Bin. But this is not a problem for the basic stamp. and you should be in good shape.
The main reason to this big mess as you probably already know is
Dec 16 = Bin 10000
Hex 16 = Bin 10110
So when you work with hex you have to always use the prefix so the program understands or the actual data wont be what you expect, because the controller actually handles that value in Bin.
Well thats my two cents Hope it helps.