Announcement

Collapse
No announcement yet.

No Touch Response with Arduino

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

  • No Touch Response with Arduino

    Hi,
    I recently started a new project and I am struggling quite a bit. My end project will control relays, however, for a test I decided to try using and LED, outputs will be similar.
    The issue I'm having is that I purchased a gen4-ulcd-35dct-clb and even though I have followed all tutorials online the buttons will not trigger any outputs, the tx and rx lights on the arduino also do not make any effort to flash, even though I am pressing buttons.
    I'm not quite sure what the issue here is, My code is below and I have also attached the 4D workshop program in rar format.
    I am using the IB board with the gen4 programming cable but I am not using the breakout board for arduino. All communications are being done through the IB.

    Code:
    #include <genieArduino.h>
    
    
    #define Relay_1 6
    Genie genie;
    #define RESETLINE 4
    
    void setup()
    {
    Serial.begin(200000);
    genie.Begin(Serial);
    
    genie.AttachEventHandler(myGenieEventHandler); // Attach the user function Event Handler for processing events
    
    pinMode(RESETLINE, OUTPUT); // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
    digitalWrite(RESETLINE, 0); // Reset the Display via D4
    delay(100);
    digitalWrite(RESETLINE, 1); // unReset the Display via D4
    
    delay (3500); //let the display start up after the reset (This is important)
    
    pinMode(Relay_1, OUTPUT); // sets the digital pin as output
    digitalWrite(Relay_1, HIGH);
    
    }
    void loop()
    {
    genie.DoEvents();
    delay(1);
    }
    
    void myGenieEventHandler(void)
    {
    genieFrame Event;
    genie.DequeueEvent(&Event);
    
    if (Event.reportObject.cmd == GENIE_REPORT_EVENT)
    {
    if (Event.reportObject.object == GENIE_OBJ_WINBUTTON) // If the Reported Message was from a Slider
    {
    if (Event.reportObject.index == 0) // If Slider0 (Index = 0)
    {
    digitalWrite(Relay_1, LOW);
    }
    }
    }
    }
    Attached Files

  • #2
    I also tried checking for responses in the GTX tool. the WinButton does not change value when pressed or depressed. Is this a screen issue or is there something wrong with my programming

    Comment


    • #3
      Hi,

      Could you please check that the Event for the Winbutton is set to report message. A button isn't automatically set to do this and needs to be enabled.

      Click image for larger version

Name:	ReportMessage.png
Views:	31
Size:	30.5 KB
ID:	72273

      I hope this helps

      Best regards

      Paul

      Comment


      • #4
        Hi Paul,

        Thanks for your response, All buttons that are placed on the screen are set to report message. They also have momentary set to no. I can see that the touchscreen is acknowledging touches as it does change the button colour, the touch just does not get communicated to the arduino. Just an update on this, I have now managed to get communication to gtx

        Regards,
        William

        Comment


        • #5
          Hi Paul,

          It appears that I have solved the problem. When I was programming the screen, I was not hitting the button to update banks and run. Running this command I managed to update the screen and the communications are now working. Thanks for your help.

          Regards,
          William

          Comment


          • #6
            Hi William,

            Thats great news,

            It is so easily forgotten and glad to hear it's all working now.

            Best regards

            Paul

            Comment

            Working...
            X