No announcement yet.

Multiple touches required - certain conditions only

  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple touches required - certain conditions only

    I have an 4duino I am looking to have read CAN messages and display on the screen on several forms. I am a novice, but going ok. I am stuck on a couple of things:

    1) On each form (each its own function), the data that is updating runs inside the following:

    // Items to loop
      while (status!=2)
    // SPEED
        LedDigitsDisplay(Display, hndl, VAL, iiCustomdigits1, 89, 3, 1, 70, 0) ;  // LARGE_3_NODEC
      // READ CAN MSG
    This works fine - if the screen (anywhere) is touched and released it goes to the next form in sequence out of 6 of them (code not shown, but basically it goes back to the main loop which is just a list of functions, one per form) ... however.... within ReadCAN() there is an if statement which goes to a 7th form (to show a warning). Once it has been there and the conditions no longer require it, it returns to the previous form. For each time it goes to this form and returns, the screen needs to be pressed once before it will respond to a touch to go to the next form. Its almost like there is a queue of unsatisfied screen presses... Am I missing something? Is there a function I can use to clear the request? What would the best practice way of doing this be?

    2) I am also having trouble with the 4Duino freezing after 5-25 mins. This seems to be on the arduino side of things and I am still working on it, but thought I would note it. Disabling touch doesn't affect it so I believe the issues are unrelated. Lengthening the time between generating variables (eg from 200ms to 500ms) seems to have a greater effect. The attached version stopped at 384 seconds. I have had previous versions run up to 20-30 mins, and am a little unclear what I might have changed that helped between versions...

    Project is attached - stripped out all CANbus related stuff to make it slightly less large.
    Attached Files

  • #2
    As a follow-up, I have tried commenting out the function that tests the warning and causes problem (1) above. Without that in there, problem (2) also isn't a problem ... so they do appear to be related and I need to rethink how I switch forms in my "warning" state.

    (edit) - and have now changed the code so it always goes back to loop() before switching forms. Still testing but this appears to have fixed both problems....

    (and a further edit) - after 6 hours without freezing I think I can safely say this is solved.
    Last edited by CamB; 7th December 2017, 02:07 PM.