Announcement

Collapse
No announcement yet.

Serial comunication from Arduino to display uLCD-70-DT

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

  • markl
    replied
    Doff,

    You are Awesome , you answered several questions, I really appreciate the working example. I had read and worked through the String examples and studied the ITOA function, but just couldn't make it all work. Gosh, that's a lot of code space to have a single digit in my message. I may have to rethink my program. Thank you for your help.

    Mark

    Leave a comment:


  • Doff
    replied
    Hi Mark,

    Page 12 of the application note ViSi-Genie Labels, Text, and Strings

    http://www.4dsystems.com.au/appnote/4D-AN-00013/

    discusses the difference between predefined and dynamic strings.

    Page 13 of the application note

    ViSi-Genie Writing to Genie Objects Using an Arduino Host

    shows how to write to a predefined strings object.

    Pages 6 and 7 show how to write to a dynamic strings object.

    http://www.4dsystems.com.au/appnote/4D-AN-00018/

    On page 7 it says:

    Note that for all three examples, the second argument for genie.WriteStr() is a pointer to a null-terminated character array. Section 2.1.3.3 Write String (ASCII) Message of the ViSi-Genie Reference Manual emphasizes this.


    Since your counter is most likely an integer, you will need to convert it to a null-terminated character array using the function "itoa(...)".

    To come up with an output such as

    "The temp reached dangerous levels n times".
    where n is the changing value of the counter, you will have to correctly join together at least three character arrays. This operation is similar to string concatenation.

    Attached is a working example.


    Hope this helps and regards.
    Attached Files

    Leave a comment:


  • markl
    replied
    Mark, I have a question concerning writing strings from a Arduino Host to uLCD-35DT. I can write stings to the display but I want to take an integer variable that keeps a counter and send it along with the string. How can I do this ? I can write to an OBJECT, but this is just a string that is triggered by values received from a temp sensor. So when the temp reaches a certain level, I want to be able to say "The temp reached dangerous levels 3 times".

    Thanks for your help,

    Mark

    Leave a comment:


  • markl
    replied
    Mark, I'll have to look for that genie magic example, I didn't realize that you could call a visi genie program😃 I haven't really sorted everything out but I am using the arduino to manage all the pins and also to monitor temp and ph. The nice thing about visi genie is that it handles all the communication and the event handlers make it simple. I just need to figure out how I want to connect everything, and ask for a few pointers when I get stuck.
    Thank you,

    Mark

    Leave a comment:


  • ESPsupport
    replied
    You certainly can call a ViSi-Genie program from a master program. You've always been able to do this, the issue was getting Genie to 'exit', so that the master program could get back control. With Genie Magic it is easy to exit Genie, there is a sample called 'ExitGenie'.

    What sort of serial communication are you looking for. It's pretty straight forwards, but if you look inside Serial or Genie it is a bit hard to follow because it is so 'compact/optimised'

    Leave a comment:


  • markl
    replied
    I too have a couple of question concerning serial communication between Arduino and a uLCD-35DT set up as 4DGL. I am interested in sending and receiving serial communication between the display and an arduino when using the display as the master. Can you suggest an example of this type of set-up. I would use Visi-Genie if I could, but because I can't call a visi-genie program from a master program I can't use that method. I will have several different 2 way communications going. One is to display the temp when the sensor is connected to the 35DT. Another is telling the arduino to set different pins high or low, and then getting an indication from the Arduino that its been done. Again, I can do these things using VisiGenie, but I am looking for an example just using Visi and 4DGL.

    Thanks for your help,

    Mark

    Leave a comment:


  • tntsei
    replied
    Hi Doff.....

    I read your email and i wanted to thank you for your kindness!!!!

    In any case i finally managed the string with the display!!!!!.....it was sufficent add two delay in the Arduino program!!!!....The other problem was that when i charge the custom font to write the string, the font wasn't able to read the string!......but in any case i solved this problem!!!!!

    I really thank you so mutch!!!

    Best regards

    Leave a comment:


  • Doff
    replied
    Hi Tntsei,

    I have sent back thru email your ViSi project, with comments in it. I think you should use buffered serial comms in your ViSi program. Please note that Arduino uses buffered serial comms in the background. In 4DGL, you have to do it yourself. You have more coding to do, but more control. Please see my previous post about this. The 4D display and the Arduino controller are not synchronized all the time, such that when the Arduino sends "Hello World", the display may not receive the entire string if it's doing something else. The string will have to be buffered. It is best for you to use a logic analyzer and see how your interface works in real time. The other problem - your ViSi project hanging up - I shall investigate on this further.

    Best Regards.

    Leave a comment:


  • tntsei
    replied
    Hi Doff

    This morning i send to you an email with my project

    Best regard!

    Leave a comment:


  • tntsei
    replied
    the error it's generic......when i try to upload the message, the error is invalid format.....if i try to update the project with the zip functionality in workshop, the problem it's the same....
    Monday i send an email to the address that you gave me

    Leave a comment:


  • Doff
    replied
    Hi Tntsei,

    What exactly is "error format file"? You should be able to fix it since I wouldn't be able to open your project anyway if it has missing files. Ideally you should post your project here so other users can see and may help.


    doff(at)4dsystems(dot)com(dot)au

    Regards.

    Leave a comment:


  • tntsei
    replied
    Hi Doff.....

    Unfortunantely i' can't upload the file zip of my VISI project....i have an error format file.......
    If you give me an email i send it all the project!!!

    Leave a comment:


  • Doff
    replied
    Hi Tntsei,

    Your ViSi project has missing files. I could not open it. To ensure that your files are intact, go to the File menu in Worskhop and select "Zip Project". Also, your Arduino sketch uses the Ethernet library and most of the code is mainly for talking to an Ethernet module. As I have requested before, please try to simplify your code such that it contains only the 4D-display-related codes with which you are having a problem. I cannot really run your code as it is now since I do not have an Ethernet module and it is likely that I will break something if I attempt to simplify it.

    Regards.

    Leave a comment:


  • tntsei
    replied
    Hi Doff

    I have attacched my project

    Regards

    Tntsei
    Attached Files

    Leave a comment:


  • Doff
    replied
    Hi Tntsei,

    You can post a simplified version of your project files. Perhaps you can simplify your 4DGL and Arduino programs to a bare minimum, give a description of what they're supposed to do, and identify the problems you are encountering. I will then just insert some codes or do some minor changes if I can find out what's wrong. That way, we can help each other. If you post a very big project using lots of devices (which I may not have here) and libraries, I may not be able to help.

    Regards.

    Leave a comment:

Working...
X