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,631


    Did you find this post helpful? Yes | No

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

    have you read the pbp manual and understood the syntax for
    Output Modifiers for Formatting Strings using arraywrite ?

    its all there
    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

    Hi Richard,

    my fault, yes i have read the arraywrite - arrayread command and corrected the code in my previous edited message.

    Many thanks.

  3. #3
    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 have a question regarding the library and the code for the nokia 3310.

    for the following code:

    Code:
    ARRAYWRITE speed [dec var1,dec2 var2,0]
    LCDSTR x,y, buff
    VAR1 is a byte and VAR2 is a byte as well. Those two numbers are presenting the Speed in format VAR1,VAR2 (where VAR1 can be any number from 0 to infinity, and VAR2 can be any number from 0 to 99)

    In case that the VAR1 gets the variable from 0 to =<255 the it can be used as a byte.

    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?

    If i set speed (VAR1 VAR2) as word then the following command

    Code:
    LCDSTR x,y, speed
    does not accept word.

    Could you please help me to get the speed as an integer and read it as it is.

    For my program i'm testing:

    Code:
    if speed is > 5086 then limit ; 50,86
    thanks once again.
    Last edited by astanapane; - 4th September 2020 at 10:18.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    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 11:03.
    Warning I'm not a teacher

  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

    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.

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    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

  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

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

Similar Threads

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

Members who have read this thread : 3

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