Announcement

Collapse
No announcement yet.

problem communicating with arduino from 28ptuAR

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

  • problem communicating with arduino from 28ptuAR

    Hello,

    I am in need of help I am fairly new to using 4d systems products I am currently building a project using Arduino and 4dsystems ULCD 28ptu ar display and RfID as a race timer for show-jumping event.

    I am looking to use a win button or any button to start and stop the timer and a button to add time penalties. I would like to time to be displayed on the screen ether using the LED's or serial element I also want to use a keypad to input data into Arduino ie contestants names and information and the number of contestants using keypad.

    I am unable to get the buttons to work I attempted to just turn a LED on to test communications to no avail I have them set to report message on the visi environment. and momentary set to no I checked various examples but don't seem to be able to get it to work.
    The menu that I have designed is working as it does not need to report messages to Arduino.
    however the buttons are not nor are the keypads.any help would be appreciated. I have included some of the sketch I am aware that the baud rates may no0t be matching as I had changed them to different values to test.

    could some on please help or explain how to set up a button using 4d systems and Arduino. I have the screen connected via shield the programming perhaps I am doing something wrong

    Kind regards Anthony
    Attached Files

  • #2
    Hi Anthony,

    I couldn't open your workshop project, 'project_display.zip'. Could you try sending again? but first click 'File' - 'Zip Project'.

    For the meantime, I have created and attached a simple genie project which has two winbuttons. This works well with your Arduino Sketch, 'object.ino'. You might want to try that out with a simple LED on pin 12.

    Make sure the Baud Rate match by checking at the 'Projects' Tab - Comms Speed. 9600 is indicated on your Arduino sketch.

    You can also try connecting the display to the workshop and use the Terminal 9600 and Terminal 115200 then press on the winbuttons to check what baud rate it is currently using.

    Also make sure that the header pins on the Arduino shield is connected properly, D0 - RX and D1 - TX.

    You can also try this Application Note for implementing Keypads: (pdf file and zip project included)

    4D-AN-00188: Visi-Genie Password Implementation with an Arduino Host
    http://www.4dsystems.com.au/appnote/4D-AN-00188/

    Hope this helps,

    Attached Files

    Comment


    • #3
      Hello,
      thanks for your reply. I have uploaded another one there hopefully this works.
      I had the baud rates matching and I will try that program you have done thank you for the help also much appreciated
      I am going to try that code.
      Regards Anthony
      Attached Files

      Comment


      • Joseph Herrera
        Joseph Herrera commented
        Editing a comment
        Hi Anthony,

        Sorry but the zipped project still doesn't open. Some folders like the .ImgData is missing.

        You can also try checking it if is ready for sending by unzipping the project in another folder location/drive and see if it opens in your workshop as well.

        Hope this helps,

    • #4
      hello joseph,

      hopefully this is it I included the image data in the zip file. I was able to get the code working it seemed that the issue lay with the arduino for some reason it would not communicate with 4d screen. once i swapped them over to a different arduino it worked straight away from there is was able to get the buttons and keypad working just accepting a number and storing into and array to be later used the next step at the moment is to get the keyboard storing strings containg users names. i am unsure how to tackle this task . perhaps you could offer some advice. currently I am taking the charachters in and writing to the arduinos serial monitor i need to convert them to display on the ulcd.
      Attached Files

      Comment


      • sole69r
        sole69r commented
        Editing a comment
        Hello,
        I managed to get the numerical keyboards working and entering values I just need to get the qwerty keyboard working that i am able to display the written text and store names to an array I am under the impression i need to use 2 dimensional arrays to achieve this. does any on perhaps have a better solution?.

        Regards Anthony.

    • #5
      Hi Anthony,

      You can follow the attached example. Using a display and an Arduino, it shows how to save characters from a keyboard press and displays it on the screen. You can add additional buttons that saves your desired input into another container or array.

      unluckily, the previous attachment wasn't able able to load either. When sending project files, It is better to select

      'File' - 'Zip Project'

      4D-AN-00188: Visi-Genie Password Implementation with an Arduino Host
      http://www.4dsystems.com.au/appnote/4D-AN-00188/

      Hope this helps,
      Attached Files

      Comment


      • #6
        Hello Joseph,
        Thank you for the reply I have the arduino side of things working now. I can store data into a 2d array and print the ascii characters as they are displayed on the keyboard using arduino serial monitor, however on the uld each character is only displayed as it's ascii equivalent as a number. And Just one at a time. I have used a simular approach to the example you have provided me which works fine for a keyboard simular to the one in the example and displays numeric values fine.
        I would like to display alphabetic characters on the ulcd as a string in the same manner as the example.

        I will post my code tomorrow. Do I need to convert the char data from the arduino to something else to prevent it displaying it ascii in the genie.write.string statement ?.

        Regards Anthony.

        Comment


        • #7
          Here is a copy of the code you should be able to see what I am saying about the keyboard. When I try to zip the 4d project it does not seem to work.
          I apologise about how lengthy the code is.
          Attached Files

          Comment


          • #8
            to print the decimal into a character you can cast it
            example
            Serial.println((char)temp);

            Tony

            Comment


            • #9
              Hi sole69r,

              I have attached an edited version of the example password project.
              The 1st form lets you print number strings while the 2nd form prints alphabet strings.

              The attached project operates on 9600 baud. and software serial on Arduino.
              In your Arduino sketch, it uses 200000 and Serial1.

              I also used the same "if" condition in your code: =)
              if ( (keyboardValue!= 13) && (keyboardValue!= 8) ...

              Hope this helps,
              Attached Files

              Comment


              • sole69r
                sole69r commented
                Editing a comment
                Hello all,

                Thank you very much for your help I am very grateful. I managed to get it working before I had looked at the forum however I will have a look at your code perhaps it is more efficient than my own. There was some problems when I edited the keyboard the enter value had changed I have since changed them also an issues was that i was not correctly writing the data to a character string. When I was performing a genie.string print i was only passing one value as opposed to the string.

                I have one final question is it possible to print multiple lines to a string box in a manner similar to that of the serial print command on Arduino. I would like to print various lines of data for example. i know that this would be possible in Arduino using a for loop and serial.println(); function for example,

                for(int x; x<5; X++){
                Serial.println("Rider ");
                Serial.print(x+1);
                Serial.print(" time");
                Serial.print(time);
                }
                Resulting in the following text on the serial monitor:

                Rider 1 time =
                Rider 2 time =
                Rider 3 time =
                Rider 4 time =
                Rider 5 time =

                I am currently only able to write a single string to text box using the genie.writeObject command containing the data and so on irregardless of the size of the string box. I looked in the example on Arduino but did not see any particular syntax for printing newlines to a the print statement. is there something that i am missing?.

                Kind Regards Anthony

            • #10
              Hi Anthony,

              You could try something like this one:

              Code:
              String myString;
              
              myString = "Rider 1 time = ";
              myString += "5.6 min";
              myString += "\nRider 2 time = ";
              myString += "\nRider 3 time = ";
              
              genie.WriteStr(0, myString);
              This prints on the screen:

              Rider 1 time = 5.6 min
              Rider 2 time =
              Rider 3 time =

              Regards,

              Comment


              • sole69r
                sole69r commented
                Editing a comment
                Hello Joseph,

                I will give that a try later on today. Thank you for all of the assistance you and the rest of the staff and users on this forum have been very helpful.

                Regards Anthony.

              • sole69r
                sole69r commented
                Editing a comment
                Hello Joseph,

                That worked for me thanks very much for your assistance.

                Regards Anthony
            Working...
            X