Announcement

Collapse
No announcement yet.

Changing to a uLCD 43DT to control a stepper motor driven macro rail

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

  • #76
    Ha, me neither buy having a go! I will copy the program to a Mega and enable serial1 for the display then try your suggestion out tomorrow.
    Thanks for trying to help me (Again).

    Comment


    • #77
      Hi,

      I have added a line in your magic code 0 event. I am not 100% sure if this was the problem but it will now update LedDigits 2 & 5;

      func UpdateSend(var newval)
      WriteObject(tLeddigits, 2, newval) ;
      WriteObject(tLeddigits, 5, newval) ; // this works like a set from controller, none of the objects events will trigger.
      SendReport(REPORT_OBJ, tLeddigits, 2, newval) ; // We need to send reports using this code
      // A magic event cannot 'cascade' into a report as the values altered by it are not
      // 'visible' in the normal report event code.
      endfunc

      I hope this helps

      Best regards

      Paul

      Comment


      • #78
        Hi Paul
        Thanks for that, I am sure this will now update the Leddigits5 so that will be 1 problem solved BUT: -
        I have put the program on a Mega 2560 with the display on Serial1 and used the 3 lines of code that tonton sent me in post 70 and i can see nothing being reported when i press the up and down buttons.
        The Leddigits2 change but they are not sending the info to my Arduino which i need as they are used in a variable.

        To prove this I also ran a Serial.print (ledDigit2_val) which is the variable that should be updated by the report message from Leddigits2, this is not working either.

        Comment


        • #79
          Hi,

          Can you try and put the event report on LedDigits5 events to see if it makes any difference. I noticed in the magic code that there is a report being sent from there and also from LedDigits2.

          Paul

          Comment


          • #80
            Hi Paul
            Changed the Maic code and as expected the Leddigits5 increases or decreases with the push of either the up or down arrow
            serial monitor is showing each button press (except the magic buttons)

            Changed the event on Leddigits5 to report message and amended the Arduino program to catch the event from Leddigits5 and update the variable ledDigit2_val, this has not worked either, a serial.print(ledDigit2_val) has confirmed this.

            Comment


            • #81
              Just changed the variable manually with a value and ran the program okay, for some reason neither of the Leddigits2 or 5 are reporting

              Comment


              • #82
                Hi,

                I tried usuing GTX to see if anything was being reported by Visi-genie and I wasn't getting anything back. I will have another look at it today.

                Paul

                Comment


                • #83
                  Dear Techno,

                  1.) The stepper motor's delay has nothing to do with the display module. If the Arduino instantly receives the Report Event Serial Byte, then the problem lies on either the hardware (stepper startup voltage, stepper motor board, etc.) or the stepper motor library.

                  You can test if the Arduino instantly receive the Report Event by placing a Serial Comms for debugging, just place a Serial.print() and check if the Report Event is received at the correct moment.

                  I also suggest that you configure your hardware power supply correctly, the 43DT display module takes up to more or less 400mA, If all of them draws power from the Arduino, your stepper motor may have a hard time starting up.

                  2.) I do not know the contents the softRestart() function, I cannot find it in the .ino file that you provided. As long as there is a blocking function (while, delay, etc.) the Arduino will not read anything from the serial lines until the blocking function is completed. So if you press something while it is performing under the while loop, it will not read it.

                  Comment

                  Working...
                  X