splitting 12 bit values into two variables, 8+4
Hello,
I have a 12 bit ADC, and I'm trying to save the values into the 25LC640 EEPROM. How do I split the 12 bit values into a 8 bit variable and a 4 bit variable for storage, and then reconstruct it when I went to read? I'm using a BASIC Stamp 2.
Thank you very much!
I have a 12 bit ADC, and I'm trying to save the values into the 25LC640 EEPROM. How do I split the 12 bit values into a 8 bit variable and a 4 bit variable for storage, and then reconstruct it when I went to read? I'm using a BASIC Stamp 2.
Thank you very much!
Comments
·· You will actually have to use a 16-bit variable and save it as two bytes.· The upper bits will be ignored.· I hope this helps.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com