Dummy needs LCD tutorial,
Hi All,
I start with PICs and have some problems regarding LCD display.
For a 628, i wrote some lines of code to read a frequency in PORTA.4 and display the result after applying a formula.
The format of the displayed datas is like 0 km/h to 180 km/h
When the data displayed is for ex. 120 km/h and the next one 10 km/h i have the remaining m/h of the first data still displayed , so i have 10 km/h h displayed.
Do i have to clear the LCd before each display or format the data to have the same length to avoid this problem ?
Also, if i want to display a small cursor ( like || ) that would move on the line like a bargraph, how can i create and display this ?
Is there a tutorial about LCDs somewhere ? I didn't find it.
Greetings from Corsica, Patrick.
1 Attachment(s)
Corsicaaaaaaa de mes amours ....
Hi, Patrick
I Committed something about bargraphs, some years ago, I do not know where it was coming from ( Parallax, may be ...)
Here is a listing to show ...
Alain
Porting Bargraph include to other Picbasic.
Hi Darrell,
I too like your include and already posted a question about it, but did not get any answer.
I would like to use it with another Picbasic.
In one line you have : Remainder = R2
What is this R2 ?
Do you know if your file has been ported to other versions of Picbasic ?
Thanks,
Quote:
Originally Posted by Darrel Taylor
Absolutely Possible!
You can have as many bars as you can fit on the screen. They can come and go anytime you please.
Just remember that when you're finished with 1 particular BAR, call the BARgraph macro 1 more time with a 0 value, to clear the area that it used. It's more efficient than clearing the screen, and re-drawing everthing else. Looks better without the flicker too .
<br>
Glad you like it! Thanks!
Different way to store CGRAM ?
Hi again !
I found a small example of a bargraph that i can make working with the demo version. I can't include Darrel's include...
It works OK, and i could modifiy it to my needs, i understood almost all the code except the method used to store in the CGRAM :
Lcdout $FE,64,0,0,0,0,0,0,0,0 ' blank
Lcdout $0,$10,$10,$10,$10,$10,$10,$0 ' |
Lcdout $0,$14,$14,$14,$14,$14,$14,$0 ' ||
Lcdout $0,$15,$15,$15,$15,$15,$15,$0 ' |||
Following the different other codes i've found, i would have done it this way :
lcdout $FE,$40,$00,$00,$00,$00,$00,$00,$00,$00
lcdout $FE,$48,$10,$10,$10,$10,$10,$10,$10,$00
lcdout $FE,$50,$14,$14,$14,$14,$14,$14,$14,$00
lcdout $FE,$58,$15,$15,$15,$15,$15,$15,$15,$00
or for last line lcdout $FE,$58,REP $15\7,$00
How is the 1st method working ??
BTW what does LCDOUT $FE,$CE make ?
also LCDOUT $FE,$80+1 would move the cursor to first line second character ?
FYI, i changed from the "other" compiler to MELabs one.... ;-)
Greetings,
All display problem solved, but ...
Hi all,
And thanks for all the infos. Now i've understood most problems and i can display almost all what i want and it will be enough for my project.
I have to measure currents and voltages that are moving rapidly, they follow the voice shape.
I used the code sent here in this post by Acetronics. I removed all what i did not need and it works perfectly.
As the display is moving fast, it would be nice if i could display a "holding bar" for a few moments at the peak value.
What is the best way to store the peak value in a variable ?
Maybe somebody has already made a similar code ?
For the moment i did not use an analog input, i randomly generate the values.
Greetings,
Re: Dummy needs LCD tutorial,
Quote:
Originally Posted by
Melanie
When displaying your km/h data, suffix it with one or two ASCII spaces ($20 Decimal 32). This will overwrite any characters remaining from the end of the prvious display.
It's neater to RIGHT JUSTIFY numeric displays, this saves the km/h waving about along the right-hand side of the numeric value which becomes a distraction... this probably will look a lot more professional...
Code:
LCDOUT $FE,$80
If kmh<100 then LCDOUT " "
If kmh<10 then LCDOUT " "
LCDOUT #kmh," km/h" ' note no trailing spaces required
rather than this, which despite being simpler code, ends up looking tatty...
Code:
LCDOUT $FE,$80,#kmh," km/h " ' note the couple of trailing spaces here
I know this is an old post... But when I try to enter an lcdout statement with a pair of quotes, I get an error saying empty string not allowed. Oh hell, I think I answered my own question. It's because I forgot the space between the quotes... Right?