Announcement

Collapse
No announcement yet.

QWERTY keyboard writing to string object help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • QWERTY keyboard writing to string object help

    Hello and thank in advance for any help.

    I have created a form with a standard qwerty keyboard and a string object on the uLCD-32-ptu. Using the raspberry pi as the host, the key presses on the keyboard are send to the pit, stored in a variable and then sent back to the string object on the screen. So far all the buttons worked as intended except for the backspace and enter keys. I fixed the backspace button with some coding on the rpi but the enter key breaks the display no matter what i do. By default the enter key sends the ascii value 13, carriage return, this causes text to restart on the same line and writes on top of old text on that line, not overwrite but like how a type writer would write over text. If i try to change its value to 10, line feed, the string starts displaying two seperate strings alternately.

    Please help with this issue.

  • #2


    Can you post a picture of what you are seeing and what you think you should be seeing.

    As you have worked out, you need to process 'special' characters on the rPi.
    Mark

    Comment


    • #3


      The picture attached shows what happens if the enter button is left as a carriage return.

      As you can see when the enter button is hit the text gets overwritten and becomes garbage. When i alter the enter button to send the ascii value 10, for line feed, instead of the default 13, for carriage return, well this part is hard to show in a picture. Basically, say i type abcdefg on the keypad, without even touching the enter button, the output will be something line abcd, then this string will be replaced by efg, and they two strings will alternate, being displayed one at a time. This makes no sense to me at all, so i'm hoping to find help here. Forgive me if i left anything out, i'm new to this forum stuff.

      Comment


      • #4


        If you send a CR (0x0d) I would expect to see what you are seeing.

        If you send a LF (0x0a or 'NewLine' in Unix parlance) I would expect to see what you were hoping to see (I think, at least that's what I see in my test, see below).

        I suspect the rPi is doing something 'special' when it sees the LF, not sure what or how, maybe it is in the string handling functions of your programming language.


        If you fire up Terminal (one of the workshop utilities) click 'send hex' and type 0200076162630a64656608
        I see

        abc
        def

        on a simple Genie program with a strings object, I would hope you would too.
        Mark

        Comment


        • #5


          i did what you suggested and it worked, however, when i tried reconfiguring the keyboard object to send ascii 10 instead of 13 i had no luck. So i altered my c code to check for the value 13 incoming and change it to 10 before appending it to the character array i created. This worked. Thank you for your help.

          On the topic of string objects though (i didnt know if i needed to start a new thread to ask this), when i read from a text file on the rpi and then display this text on a string object on the LCD, the font gets weird, see picture below. Any idea how to fix this? The font in the text file is tomaha i think, it looks like the font of this message not what's displayed on the screen.

          Comment


          • #6


            Updating Workshop (assuming you are not already using it) to the latest version will fix that.
            Mark

            Comment


            • #7


              I have been working on other aspects of my project such as trying to get email to work. But i recently downloaded the newest version of workshop 4 as you suggested and the font issue is still present. Please help.

              Comment


              • #8


                Can you post your source or email it to mark at 4dsystems dot com dot au ?
                Mark

                Comment


                • #9


                  Sorry for the late reply, been working on getting my RPi to receive emails and failing lol. What do you mean by source?

                  Comment


                  • #10


                    The workshop4 project/prgrams (source).
                    Mark

                    Comment


                    • #11


                      I emailed the contents of the folder for the visi genie program to you under the subject "source code". Thanks for the help

                      Comment


                      • #12


                        Please help soon, i have managed to solve almost all other problems besides this one

                        Comment


                        • #13


                          I responded to this as a reply to your email. Here it is again in case you can't find it


                          The font in ‘strings0’ is currently set to blank, so Windows has ‘chosen’ the font that you are seeing.



                          I have set it to other fonts and it always seems to ‘remember’ what was set, but I suspect there is some odd mechanism that is blanking it out.



                          If you can get a handle on how to make this reoccur I’d appreciate knowing how.
                          Mark

                          Comment


                          • #14


                            Thank you, i had not noticed that at all. I deleted the old string object and placed a new one. Now the font is showing 4D Font3 (8x12), like all the others. i have not tested this yett but i'm assuming that this will fix the issue. Thanks for pointing that out.

                            Comment

                            Working...
                            X