I am trying to create a bargraph display. It has 16 segments. My routine uses a calculation of an upper bound limit for what the display should be reading and a lower bound limit.
Code:
GraphDivider = (GraphMax - GraphMin) / 16
GraphVal = (X / GraphDivider)
Everything to do with this graph is using word variables.
So lets say my graph top value is 100, and my graph lower value is 0, and X = 50:
(100 - 0) / 16 = 100 / 16 = 6.25
50 / 6.25 = 8
Thats exactly the result I expect to get. Now, to display the number 8 on the graph (having the first 8 LED's lit, the binary number I would have to send would be %0000000011111111
Is there a way to tell pic basic to set the first 8 bits on? Looking through the documentation I see I can set bit 8 with DCD=7 but that will leave all other bits at 0
Bookmarks