Announcement

Collapse
No announcement yet.

Serial comunication from Arduino to display uLCD-70-DT

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

  • #16
    Hi Tntsei,

    The program it's unable to show the string on the display...
    Did you happen to use third-party fonts? If yes, you will have to uncomment the relevant lines in the program skeleton. This app note will help you:

    4D-AN-P3001 ViSi Displaying Third Party Fonts

    App notes are here: http://www.4dsystems.com.au/appnotes


    IF i want send an ACK message to the display how can i do with Arduino?
    I think it would be:

    Serialx.print(0x06);

    Where "x" is the serial port (omit if using Serial0), and "0x06" is the hex value of ACK in the ViSi-Genie comms protocol, if that is what you are referring to?

    Regards.


    Doff

    Comment


    • #17
      Sorry Doff i' write the wrong word........the program it's ABLE and not UNABLE.....sorry ....

      For the ACK message, the problem it's that serin() it's function that don't read strings but always char.....for this reason if i want realize an ACK with serin i need to send only a char to the display.......

      For examples ...

      Arduino IDE

      Display.print(F("Z")); // i send Z to the display to realize ACK

      Worshop IDE

      repeat

      while((char := serin()) > 0 )

      if(char != 'Z')

      putch(char); // in this manner char Z isn't print to display
      endif

      untile(char == 'Z') //when ACK signal arrive i finish the function


      Comment


      • #18
        Hi Tntsei,

        Did you want the character 'Z' as the ACK byte? Such that the display waits for it to arrive then it does something? If yes, shouldn't the 4DGL code be something like,

        Code:
            repeat
                while((char := serin()) < 0);   // wait for a valid character
                if (char != 'Z')                // if the received character is not 'Z'
                    putch(char);                // print it on the screen
                endif
            until(char == 'Z');                 // end loop if the received character is 'Z'
        Regards.
        Doff

        Comment


        • #19
          Hi Doff.....

          Yes i have exactly impelmented yout item!!!

          Comment


          • #20
            Hi Tntsei,

            Sorry for the late reply. How are you getting on with your project? Were you able to implement your own way of sending and receiving an ACK?

            Regards.
            Doff

            Comment


            • #21
              The problem it's this:

              i have the Arduino host that evaluate a password sendign by the display with another custom keyboard...the keyboard it's always numeric.

              The display send the numeric password to arduino which responds with an ACK if the password it's correct, othervise don't responds.

              What happens in the display it's that charge two kind of form: One form if the password it's correct, and a second form if the password it's wrong.

              for this reasone i need to send one ACK to the display ...if the display read the ACK means that the password it's correct and charge the form for password correct, if don't read the ACK , the password it's wrong:

              Arduino IDE:

              ......
              ...
              void setup()
              {
              ...
              ...
              }

              void loop()
              {
              .......
              .......
              password_evaluation();
              }

              void password_evaluation()
              {
              ......if(password0) // first account
              Display.print("Y"); // means that the password it's ok and for this reason i send to the display the ACK

              Display.print("i'm Doff"); // this is one string that i need to send to the display, because i have more than one account with password
              // actually the display don't read this string i don't know why...
              ......

              else if (password1) // second account
              Display.print("Y"); // means that the password it's ok and for this reason i send to the display the ACK(like preaviously)

              Display.print("i'm tntsei"); // this is one string that i need to send to the display, because i have more than one account with password
              // actually the display don't read this string i don't know why...(like previously)

              else
              password0.reset(); // password it's wrong and for this reason i don't send ACK
              password1.reset();
              }


              Workshop IDE

              func main()
              ...
              ...
              ..

              if( form == savekey2) // savekey2 it's a button inside a form that change the form like follow

              repeat

              while( serin() < 0 ); // if the ack don't arrive i stay here

              if(serin() == 'Y')
              form := Password_ok; // i read the ACK and the password it's ok, for this reason i charge the form password ok
              else
              form := Password_wrong; // i don't read the ACK and the password it's wrong, for this reason i charge the form password wrong
              endif
              until(serin() == 'Y');

              endif


              Actually the problem it's that the ACK doesn't work correctly and inside the Password_ok form i don't able to read the string " i'm tntsei" and "i'm Doff"

              Comment


              • #22
                Hi Tntsei,

                Display.print("i'm tntsei"); // this is one string that i need to send to the display, because i have more than one account with password
                // actually the display don't read this string i don't know why...(like previously)
                It seems that you are using your own library? I also see that you are coding in ViSi. Can you check the data coming out of the Arduino? Perhaps you can redirect the output to Serial0 so you can see the messages on the Serial Monitor.

                Regards.
                Doff

                Comment


                • #23
                  Messages are available on the Arduino Serial monitor......i'll explain

                  Arduino IDE

                  #include <SoftwareSerial.h>

                  SoftwareSerial Display(2,3);

                  vois setup()
                  {
                  Display.begin(9600);

                  Display.println(F("hi !!!")); // message 1
                  Display.println(F("it's ok")); // message2

                  Display.println(F('Z')); //ACK signal

                  }
                  void loop()
                  {
                  }


                  Workshop IDE

                  func read _string()

                  var char;

                  com_SetBaud(COM0, 960);

                  repeat

                  while((char := serin()) < 0 );

                  if(char != 'Z')

                  putch(char);// i print every char but not 'Z' that it's the ACK

                  endif

                  until(char == 'Z'); \\ i read the ACK (Z char) and the func end

                  endfunc



                  in this way there are able to read the strings inside the display correctly

                  But if i have

                  Void setup()
                  {
                  .....
                  ....
                  }


                  void loop()
                  {
                  .......
                  .......
                  password_evaluation();
                  }

                  void password_evaluation()
                  {
                  ......if(password0) // first account
                  Display.print("Y"); // means that the password it's ok and for this reason i send to the display the ACK

                  Display.print("i'm Doff"); // this is one string that i need to send to the display, because i have more than one account with password
                  // actually the display don't read this string i don't know why...
                  Display.print(F("Z"));
                  ......

                  else if (password1) // second account
                  Display.print("Y"); // means that the password it's ok and for this reason i send to the display the ACK(like preaviously)

                  Display.print("i'm tntsei"); // this is one string that i need to send to the display, because i have more than one account with password
                  // actually the display don't read this string i don't know why...(like previously)
                  Display.print("Z"); //ACK

                  else
                  password0.reset(); // password it's wrong and for this reason i don't send ACK
                  password1.reset();
                  }



                  and i use the same function (read_string()) inside the Workshop IDE the display it's not able to read the string and i don't know why....

                  Comment


                  • #24
                    Hi Tntsei,

                    Is it possible for you to post your complete project files? I hope they're not that complicated though.

                    Regards.
                    Doff

                    Comment


                    • #25
                      The project it's very big......next tuesday i post my project

                      Comment


                      • #26
                        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.
                        Doff

                        Comment


                        • #27
                          Hi Doff

                          I have attacched my project

                          Regards

                          Tntsei
                          Attached Files

                          Comment


                          • #28
                            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.
                            Doff

                            Comment


                            • #29
                              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!!!

                              Comment


                              • #30
                                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.
                                Doff

                                Comment

                                Working...
                                X