Shop OBEX P1 Docs P2 Docs Learn Events
String functions OR more room for arrays — Parallax Forums

String functions OR more room for arrays

andoando Posts: 11
edited 2006-03-15 06:31 in General Discussion
Hello,
I need more room for variables or I need to know if there are functions that can operate on strings. Like substr. With an LCD I would like to scroll a message back and fourth. picking which characters are on the screen needs to be taken care of by my code. So I thought I would store the whole message in 4 Nib arrays 13 chars long. Since I ran out of room I am hoping there is different method.

Joe

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-15 00:24
    This documentation has BS2 demo code that shows scrolling in an LCD.· There is no substr function -- you have to code it yourself (or modify our demo code).

    http://www.parallax.com/dl/docs/prod/appmod/LcdTerminal.pdf


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • andoando Posts: 11
    edited 2006-03-15 01:10
    Jon,
    I need my text to scroll in all directions up, dn, left, right. I figure it is going to be easier to just rewrite the whole lcd with my data. I may have overlooked the eprom space. I can store my full strings there. Then write my own substr. Is there a command I can use to shift or step through a string?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-15 01:38
    If you look at that code you'll see that it is scrolling by writing a sub-section of the string. If you have multiple strings then you can scroll up/down using a similar techniques (pointer to target string and starting location).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • andoando Posts: 11
    edited 2006-03-15 03:18
    Thanks!
    I got it working using the READ command
  • andoando Posts: 11
    edited 2006-03-15 06:31
    Jon,
    Thanks for all your help. I just got her all closed up. You can see the finished project here.

    http://www.andomation.com/stuff/ouija/

    Joe
Sign In or Register to comment.