Nokia lcd include , small footprint to suit pic16's


Closed Thread
Results 1 to 40 of 111

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,699


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    i will start here
    My problem is that i need this floating number for ex. speed = 50,86 to get it as an integer speed = 5086. May i have your help please?
    you do it exactly the same way as for a lcd display

    Code:
    buff var byte[6] ; 4dig+dp+null
    speed var word
    ARRAYWRITE buff,[dec2 speed/100,".",dec2 speed//100 ,0]
    LCDSTR x,y, buff
    LCDSTR x,y, speed
    does not accept word.
    correct lcdstr str buffer var ,const str

    from the inc file
    ;################################################# #################
    USERCOMMAND "LCDC" ;X,Y,CHR 0 < X < 84 , 0 < Y < 7 , 31 < CHR > 127
    USERCOMMAND "LCDCLR" ;clear LCD
    USERCOMMAND "LCDSTR" ;STRING @ X,Y or Constant String
    USERCOMMAND "LCDCMD" ;cmd BYTE TO LCD
    USERCOMMAND "LCDDAT" ;DATA BYTE TO LCD

    i might preempt the next question
    leading zero's and right justifying fields

    http://support.melabs.com/forum/picb...strtok-usercmd
    Last edited by richard; - 4th September 2020 at 12:03.
    Warning I'm not a teacher

  2. #2
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    im not in front of the circuit and computer in order to test it.

    i havent done it as it following /100 and //100 (remainder)

    Code:
    buff var byte[6] ; 4dig+dp+nullspeed 
    var word
    ARRAYWRITE buff,[dec2 speed/100,"."dec2 speed//100 ,0]
    LCDSTR x,y, buff
    I have used it with "." like the following in the loop and i get it right on the LCD as 50,86 for example. :

    I need on the screen the right "floating" value.

    Code:
    ARRAYWRITE speed [dec var1,".",dec2 var2,0]
    LCDSTR x,y, speed
    then i send the code to sub label

    speedlimit:
    and i havent used "."

    i sent the command like:
    Code:
    ARRAYWRITE speed [dec var1,dec2 var2,0]
    having that it was not possible to use speed as word.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,699


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    i sent the command like:
    Code:
    ARRAYWRITE speed [dec var1,dec2 var2,0]
    having that it was not possible to use speed as word.
    makes no sense to me

    ARRAYWRITE speed

    speed must be an existing chr array big enough to contain the text generated plus a null terminator
    a word var could hold only 1 chr safely ,since pbp checks nothing anything could get clobbered by misuse like that
    Warning I'm not a teacher

  4. #4
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    now it makes sense why i was getting some messy chr on the screen like that.

  5. #5
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    i've tried the following but didnt work.

    Code:
    rbuf  var byte
    wbuf var word

    Code:
    checkt: 
    arraywrite RBUF,[DEC2 speed1/100,DEC2 speed2//100,0] ; for example speed1 = 56 and speed2 is 85
    LCDSTR 0,2, RBUF ; ----------> this gives 0085
    wbuf = rbuf                                 
    if wBUF > 5685 then 
    gosub limit
    return
    then i tried:

    Code:
    checkt: 
    arraywrite RBUF,[DEC speed1,DEC2 speed2//100,0] ; for example speed1 = 56 and speed2 is 85
    LCDSTR 0,2, RBUF ; ----------> this gives 5685 which is what i want....BUT!!!! when i try to check if wbuf > than 5685, it doesnt work
    wbuf = rbuf                                 
    if wBUF > 5685 then   ' IF THE TEMPC IS GREATER THAN 37 C THEN LIGHT UP THE BLUE LED
    high lata.0
    ELSE
    low lata.0
    endif
    return
    how is it possible to combine those two speed1 and speed2 vars in one var? and check then the result as an integer number?

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    You have only declared "rbuf var byte" It is being used as a pointer as far as I can see. It will be NO LARGER than 255.
    Dave Purola,
    N8NTA
    EN82fn

  7. #7
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Hi dave,

    i solved it.

    i used the rbuf as var word

    Then i didnt add the commands for

    Code:
    arraywrite rbuf,[dec speed1,dec2 speed2,0]
    i used the above command only to combine it with the following and present the number to the lcd.

    So the solutions for me is:

    Code:
    checkt:
    RBUF = (SPEED1*100) + SPEED2
    IF RBUF > 5682 THEN ; THIS IS JUST AN EXAMPLE
    GOSUB LIMIT
    RETURN
    Thanks a lot for the help all of you.
    Last edited by astanapane; - 4th September 2020 at 19:23.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 05:47
  2. 16F946 pcb footprint (64 tqfp)
    By nomad in forum Schematics
    Replies: 2
    Last Post: - 8th September 2009, 12:14
  3. small 2X16 LCD
    By Ron Marcus in forum Off Topic
    Replies: 2
    Last Post: - 26th October 2007, 21:37
  4. Nokia 3310 LCD
    By barkerben in forum General
    Replies: 3
    Last Post: - 10th December 2005, 20:08
  5. Small LCD module,character
    By Ron Marcus in forum Off Topic
    Replies: 6
    Last Post: - 27th November 2005, 19:13

Members who have read this thread : 2

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