My application is to bus an AT043TN24 V.7 LCD 272 X 480 pixel. Using 3 bit for color 2 pxl can be contained in 1 byte and the full display would then contain some 272 x 240=65280 addresses in RAM.I am getting the pxl (graph) points from 8 bit ADC which then produces 256 points out of the 272. I now need from this dec number up to 65280 the 2 binary bytes to constitute the address bus.Can you please suggest a way for the code to produce the 2 bytes contained in the Word ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
don't you need the scale function?
word_variable = Scale (value_word , fromLow_word , fromHigh_word , toLow_wordr , toHigh_word [, calibration_integer] )
pixel16=scale (pixel,0,255,0.65280)
where pixel is your 0-255 and is stored as a word variable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My application is to bus an AT043TN24 V.7 LCD 272 X 480 pixel. Using 3 bit for color 2 pxl can be contained in 1 byte and the full display would then contain some 272 x 240=65280 addresses in RAM.I am getting the pxl (graph) points from 8 bit ADC which then produces 256 points out of the 272. I now need from this dec number up to 65280 the 2 binary bytes to constitute the address bus.Can you please suggest a way for the code to produce the 2 bytes contained in the Word ?
Take a look at "Variable Aliases" on this page of the Help files: http://gcbasic.sourceforge.net/help/_variables.html you will find it about 2/3 of the way down.
It lets you reuse the same location with different names, so a word could have the bytes separately named in addition to the word name.
Last edit: Chris Roper 2021-04-26
don't you need the scale function?
word_variable = Scale (value_word , fromLow_word , fromHigh_word , toLow_wordr , toHigh_word [, calibration_integer] )
pixel16=scale (pixel,0,255,0.65280)
where pixel is your 0-255 and is stored as a word variable.