Dummy needs LCD tutorial,


Closed Thread
Results 1 to 33 of 33

Hybrid View

  1. #1
    TK5EP's Avatar
    TK5EP Guest

    Default 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.

  2. #2
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by TK5EP
    When the data displayed is for ex. 120 km/h and the next one 10 km/h .
    Good brakes or wall?

    If you clear the LCD you will have a flickering LCD.

    For the bargraph just print the ASCII value 255 on the second line of the LCD.
    Will be like that █ █ █ █ █ █.



    Luciano

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Smile 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
    Attached Files Attached Files
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Formating

    Hi Melanie and Luciano,

    Nor good brakes or wall, simply wanting to display wind speed coming from an anemometer.
    I understand that i have to format the data so it overwrites the previous one.
    Melanie, no difference in your code if kmh<100 or kmh<10 ?

    What about displaying a moving cursor about half the wide of a full black character (ASCII 255 as you mentionend)

    I want to display the wind speed in full character in km/h and/or a sliding narrow cursor one the second line under a scale on the 1st one.

    Melanie, is there a tutorial or an good explanation about the LCD display ?

    Thanks for your help.
    Last edited by TK5EP; - 28th September 2005 at 12:40.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    No tutorial - just program, play and learn from doing.

    Assuming you'll never exceed 255 km/h wind speed (byte variable) and you don't live in Louisianna...

    My example right-justified... so the maximum you can display is three characters (100-255 km/h).

    If your spped is less than 100 km/h, then you prefix with one blank... this covers 10-99 km/h.

    If your speed is less than 10km/h, then you need to prefix with two blanks (0-9 km/h).

    Using this method, you get a stationary "km/h" label with the digits moving to the left. A lot neater than digits moving to the right with the "km/h" label flapping about behind them.

  7. #7
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Ok

    Well, in Louisinia my anemometer would be broken. It's limited to 180 km/h !

    OK, i understand it now. My 2nd question was because i saw no difference between both lines, i think you forgot a space between " " in the line for kmh<10. Do i have it right ?

    Thanks for your help, appreciated it.
    Patrick.

    Quote Originally Posted by Melanie
    No tutorial - just program, play and learn from doing.

    Assuming you'll never exceed 255 km/h wind speed (byte variable) and you don't live in Louisianna...

    My example right-justified... so the maximum you can display is three characters (100-255 km/h).

    If your spped is less than 100 km/h, then you prefix with one blank... this covers 10-99 km/h.

    If your speed is less than 10km/h, then you need to prefix with two blanks (0-9 km/h).

    Using this method, you get a stationary "km/h" label with the digits moving to the left. A lot neater than digits moving to the right with the "km/h" label flapping about behind them.

  8. #8
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Tréport, trop foooort !

    Merci Alain

    I'm starting with PICs and it's my first project. I have some good experience in BASIC but have to adapt my knowledges to Picbasic.

    I use a demo version (PROTON lite) but i'm thinking to change to Melabs, the forum and support seems to be much better !
    Unfortunately, the Melabs demo allows only 35 lines... and the registered version is a bit expensive for an occasional project !
    With 35 lines you have to be a bit tricky....

    Greetings from sunny Corsica,

  9. #9
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    > the (MeLabs) forum and support seems to be much better

    Now why do you say that? Just curiosity (though it did bring a smile when I read that). At a glance, they have ten-times the amount of activity that this forum has for roughly the same number of members...

  10. #10
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Cooorsicaaaaaaa ....

    I just forgot it was written for a 16F84 ...

    But, in Mel's answer, I didn't see something like :

    LCDOUT $FE, $80, ... to place cursor at the beginning of the 1st line, to be sure to overwrite old text ...



    Alain

    PS: si ça t'intéresse, j'ai les typons pour une petite plaque de démo Kivabien avec un buzzer, trois Leds, 3 E/S , un cavalier de reset ou config et un afficheur LED 2x16...

    ça aide ...beaucoup !!!
    Last edited by Acetronics2; - 28th September 2005 at 14:11.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  11. #11


    Did you find this post helpful? Yes | No

    Default

    For a bar graph go to http://www.picbasic.co.uk/forum/show...LCDbar_INC.bas. Darrel wrote an include file that dones an amazing job using a bar graph.

  12. #12
    Join Date
    Jul 2005
    Location
    Palmdale, CA
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Dummy needs LCD tutorial,

    Quote Originally Posted by Melanie View Post
    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?

  13. #13
    crocodilebobbie's Avatar
    crocodilebobbie Guest


    Did you find this post helpful? Yes | No

    Default LCD display

    Hi:

    I usually find a format for the LCD data which does not change and display that information formated prior to the "loop". That way the display does not flicker. The data that does display is collected and displayed inside the loop, and using pause command to slow down changes.

    does that make sense?

    bobbie

  14. #14
    Join Date
    Jun 2009
    Posts
    8


    Did you find this post helpful? Yes | No

    Red face Graphic lcd 128*64

    Hello, i need informations i want to use GRAPHIC LCD 128*64 with bar graphs etc but i dont know how i have the pic basic pro compiler and i want to know if i use lcdout it is not compatible for glcd....
    whitch are the defines???
    simple code???

  15. #15
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by davids View Post
    Hello, i need informations i want to use GRAPHIC LCD 128*64 with bar graphs etc but i dont know how i have the pic basic pro compiler and i want to know if i use lcdout it is not compatible for glcd....
    whitch are the defines???
    simple code???
    I think you didn't understand there's NO support, for the day, for GLCDs with PicBasic Pro ...

    May be ... another Basiç ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts