Nokia lcd include , small footprint to suit pic16's - Page 3


+ Reply to Thread
Page 3 of 3 FirstFirst 123
Results 81 to 111 of 111
  1. #81

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

    post is duplicated....
    Last edited by astanapane; - 27th August 2020 at 17:36.

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

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

    Does it matter that SFR are commented in the pic18f46k22 pbpinc?
    no
    I have tried the new inc and got the following errors. (used PIC18f46k22)


    Is there a way i could fix those?
    if configured correctly you won't get errors
    This is more entertaining than Free to Air TV

  3. #83
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

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

    IT needed a tweak to work for a 18f26k22
    Attached Files Attached Files
    This is more entertaining than Free to Air TV

  4. #84

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

    Richard thanks,

    tested and confirmed that is working.

    I have tested only the small font 7x5_18 as text.

    I'm trying to figure out how to display a variable.

  5. #85

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

    tested with big fonts as well.

    it is really easy to use it like that.

    Richard is there a way to print variables other than text?

  6. #86
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

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

    doesn't the demo show that with the contrast and backlight stuff ?
    what have you tried ?
    This is more entertaining than Free to Air TV

  7. #87

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

    I havent tried the demo. Just download the txt.

    As far as i understant it is using the command

    ARRAYWRITE BUFF [dec C,0]
    LCDSTR x,y, buff



    i tried and it worked.

    a = 1
    b = 2
    c = a+b
    Last edited by astanapane; - 29th August 2020 at 10:03.

  8. #88
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

    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
    This is more entertaining than Free to Air TV

  9. #89

    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.

  10. #90

    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.

  11. #91
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

    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.
    This is more entertaining than Free to Air TV

  12. #92

    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.

  13. #93
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

    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
    This is more entertaining than Free to Air TV

  14. #94

    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.

  15. #95

    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?

  16. #96
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,162

    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

  17. #97

    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 18:23.

  18. #98

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

    additional missing line from the previous message


    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.
    Code:
    LCDSTR x,y, rbuf
    in any case the solution is to use the rbuf as word, multiply by 100 the speed1 and add speed2.

  19. #99
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

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

    i solved it.


    i used the rbuf as var word

    has not solved it at all , you cannot safely use arraywrite rbuf,[dec speed1,dec2 speed2,0] with a word var as the destination
    the destination for the text chrs generated by arraywrite m
    ust be an existing chr array big enough to contain the text generated plus a null terminator
    not doing so will lead to enormous problems

    secondy to expect the result of arraywrite to be usable as a number is absurd , its a textual chr string
    This is more entertaining than Free to Air TV

  20. #100

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

    there is a missandestanding. my fault because i consfused you by using the same name for the variable SBUF and RBUF in the previous posts.

    vars.....

    SBUF var byte
    RBUF var word

    Program in the main loop includes the command:

    Code:
    arraywrite SBUF, [dec speed1, dec2 speed2,0] ;
    then there is a checkSpeed LABEL

    checkSpeed:

    Code:
    RBUF = (speed1*100) + speed2
    if RBUF > 5687 then; just an example
    gosub limit
    endif
    return
    And that is what it works for me. It is under testing for a day now, and havent seen any strange behaviour.

    thanks.

  21. #101
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

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

    SBUF var byte

    sadly still woefully incorrect.
    that reserves 1 byte , you need at least 5 bytes
    This is more entertaining than Free to Air TV

  22. #102

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

    Quote Originally Posted by richard View Post
    sadly still woefully incorrect.
    that reserves 1 byte , you need at least 5 bytes
    Do you mean something like that?

    Code:
    SBUF var BYTE[6]
    it is already configured.

  23. #103
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

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

    well done!
    you have proved yet again that code snippets are generally useless time wasters..
    this time with the nice added touch of posting snippets that bear no semblance to
    the code actually employed. a touch of genius . not


    don't know why i bother
    This is more entertaining than Free to Air TV

  24. #104

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

    Thanks for any help.

    please try to be gentle. Life is small and there are lots of good people out there.

    Have a nice day.

  25. #105

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

    Good day to all.

    I have two questions. One is related to this amazing library shared by Richard and the other one is related to a small project i have.

    1. May i add a picture to nokia LCD via the usercommand LCDDAT?

    For image data could i use the GLCD from Miktoelektronics?

    Code:
    ;##################################################################
     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
    2. Im working with some speed values. So range can be from 0 to infinity.

    How could i catch/retreive the highest value from a Variable? Is there any specific way - path to do that?

    thanks.

  26. #106
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,976

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

    Can you define infinity please?

    Your variables can be: bit (0-1), bytes (0-255), word (0-65535) and long (-2147483648 to 2147483647)

    Ioannis

  27. #107

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

    Quote Originally Posted by Ioannis View Post
    Can you define infinity please?

    Your variables can be: bit (0-1), bytes (0-255), word (0-65535) and long (-2147483648 to 2147483647)

    Ioannis
    Hi Ioanni, thanks for the reply.

    Speed is not going to exceed any value more than a logical speed targeting to a bicycle or a car. In that case as i understand we could use "word" variable.

    But there is no specific value as a limit. It can be any possible number that a variable may have.

    thanks in advance.

  28. #108
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,976

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

    Maybe the MAX operator can do what you want.

    Your check loop can be something like this:

    max_value = old_speed MAX speed

    old_speed = max_value

    But this will lead eventually to a top value on max_value and you may have to reset this value. Don't know what you try to accomplish but a periodic reset may be needed.

    Ioannis

  29. #109

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

    Thanks Ioanni,

    i will try the MAX operator.

    What i'm trying to export is the maximum speed value of a single run.

    As i'm not in my home computer right now i will try your advice later today.

    Many thanks.

  30. #110
    Join Date
    May 2013
    Location
    australia
    Posts
    1,731

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

    For image data could i use the GLCD from Miktoelektronics?
    i did look at the array generated by Mikroelektronics glcd bitmap generator and
    it seems i rejected it for that generated by lcdassistant, cannot recall why.
    none of my posted examples use mokroe files . they would all need a bit of
    work to leverage into pbp anyway


    1. May i add a picture to nokia LCD via the usercommand LCDDAT?
    the LCDDAT sends 1 byte to the lcd @ the current cursor posn
    it would not be the most efficient way to upload an image.
    i saw no way to read pixel data back from the display so i decided that the only way to
    create a decent bitmapped image function was using a frame buffer. this i have implemented
    in the c version as posted.
    implementing this function in pbb is not something i'm willing to invest the time into
    This is more entertaining than Free to Air TV

  31. #111
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,976

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

    I know 3310 LCD is the cheapest graphic LCD one can buy, but the effort to display something is too much relative to the result (B/W bitmap).

    Next best solution is the Nextion 2.4" at about 15 euros, 65536 colors, 4MB memory, 320*240 and touch with RS232 control.

    No MCU load to control the display and feedback with touch (no hardware buttons etc).

    Richard did an exceptional job on 3310 but is it worth anymore with the cheap smart displays?

    Ioannis

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, 20:08
  5. Small LCD module,character
    By Ron Marcus in forum Off Topic
    Replies: 6
    Last Post: - 27th November 2005, 19:13

Posting Permissions

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