PDA

View Full Version : Lcd



savnik
- 27th November 2006, 15:49
I have found this code , but i don't understand that.
If some know how to work , please to explain;



value var Word
fullbars VAR BYTE ' Number of full bars at left of graph
barval VAR BYTE ' Value passed to bargraph routine
partbar VAR BYTE ' ASCII code for partial bar character
pad VAR BYTE ' Number of spaces to pad to the right of graph

LCDOut $FE,64,REP $0\8 ' Load blank character (ascii $0)


LCDOut $FE, 1 ' Clear the display


barval = (value/9)+1 ' Scale 0-500 to 60 segment bargraph (1-56)

fullbars = (barval MIN 60)/3 ' Calculate number of full bars (|||).

' partbar holds the ascii code for the partial bar character: $0=" ", $1="|", or $2="||"

partbar = (barval MIN 60)//3 ' Calculate ascii code for partial bar character

pad = 19 - fullbars ' Number of spaces to fill display width.

LCDOut $FE,$D0,"VU: ", REP $3\fullbars, partbar, REP " "\pad

Acetronics2
- 27th November 2006, 17:00
I saw the very original program on the parallax site ... explanations foundable there !!!

Alain

savnik
- 27th November 2006, 21:14
I saw the very original program on the parallax site ... explanations foundable there !!!

Alain
I use this code with picbasic pro (a part of the code)

rhino
- 27th November 2006, 21:20
At first glance, it looks like a routine to do bar graphs on your LCD. If that's what you're after, take a look at Darrel's bar graph include http://www.picbasic.co.uk/forum/showthread.php?t=2359

savnik
- 30th November 2006, 07:43
anyone to help me;

rhino
- 30th November 2006, 14:33
Help with what? Documenting (documented) code? Did you take Alain's advice? What exactly do you need. It looks like the code is commented pretty well. You use this code, but don't know how it works?

savnik
- 30th November 2006, 15:36
Help with what? Documenting (documented) code? Did you take Alain's advice? What exactly do you need. It looks like the code is commented pretty well. You use this code, but don't know how it works?
I don't find Alain's advice.
I use Darrel's bar graph , but need more memory.
Yes i use this code, but i don't know how it works.

Archangel
- 30th November 2006, 20:23
I don't find Alain's advice.
I use Darrel's bar graph , but need more memory.
Yes i use this code, but i don't know how it works.
Hi Savnik,
I had to move up from a 16F628A to a 16F648A to have enough "memory"
to tryout Darrel's bargraph demo, you will need to compile with MPASM too.
JS