I think I don't quite understand the question. Your lcd can only show in decimal 1 through 48, so shouldn't decimal be ok to work with? If you are asking about how to average your remainder so you can display the right pixel, then you could do your divide by 100, for the pixel, then take your remainder. If your remainder > 49 then pixel = pixel + 1. This is saying that if your division returned 24.5 or higher, it would be displayed as pixel 25. This would smooth out your line graph a little bit.
Is that what you are getting at?
Or, if you are saying that you do have a decimal point (or a decimal after your whole number), then you can do something with it. Same as above, but if you have 245, then 245//10 will give your remainder. If remainder > 4 then pixel = pixel + 1
Added:
Ok, if you're asking how to figure out what page and pixel to display.......:
Say you want to display pixel 10 of the 48 pixels. 10/8 = 1 so it is on page 1 (of 0 to 7 pages). Now for the pixel of that page, you take the remainder 10//8 = 2. So it is pixel 2 on page 1 we need to display.
Last edited by ScaleRobotics; - 5th May 2009 at 21:52.
http://www.scalerobotics.com
Bookmarks