Announcement

Collapse
No announcement yet.

slider value problem

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

  • slider value problem

    Hello,
    I’m using visi Genie with an Arduino Mega and the uLCD-32PTU display.
    I made a project of two sliders and two led-digits. I just want to display the value of the slider with the corresponding led-digit but sometimes the value of one slider is displayed in both led-digits (In the serial monitor the values are correct).
    If I press the touch for too long, the display gets black (I think only display reboot). Can you explain the strange behaviour to me?
    Regards
    Joshi
    Attached Files

  • #2
    Hi Joshi,

    Thank you for contacting us.

    Please be advised that you can display the value of the slider corresponding to the led digits that doesn't require any code. Kindly refer to this application note https://www.4dsystems.com.au/downloa...0002_R_1_0.pdf to be guided.

    Regarding this “If I press the touch for too long, the display gets black (I think only display reboot). Can you explain the strange behaviour to me?”

    I tried replicating the issue, however, I didn’t encounter it on my end. Would you mind sending us your zip project (Arduino code and WS4-Visi Genie project) containing the issue, for further analyzation? Kindly open your project in Workshop4, go to File and click Zip Project.

    And it would be helpful if you can attach a video concerning the problem.

    Regarding your code project, I have noticed that in line 63 “genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0, lowerlim)” is still denoting to update the first led digits. As you want to update the another led digits object, the command must “genie.WriteObject(GENIE_OBJ_LED_DIGITS, 1, lowerlim); ”.

    You can also minimize your code similar to this,
    Code:
    if (Event.reportObject.cmd == GENIE_REPORT_EVENT) {
      if (Event.reportObject.object == GENIE_OBJ_SLIDER) {                // If the Reported Message was from a Slider
        if (Event.reportObject.index == 0) {                              // If Slider1 (Index = 0) 
          lowerlim = genie.GetEventData(&Event);                          // Receive the event data from the Slider0
          genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0, lowerlim);           // Write Slider1 value to LED Digits 0    
        }
        else if (Event.reportObject.index == 1) {                         // If Slider0 (Index = 1) 
          upperlim = genie.GetEventData(&Event);                          // Receive the event data from the Slider1
          genie.WriteObject(GENIE_OBJ_LED_DIGITS, 1, upperlim);           // Write Slider1 value to LED Digits 1   
        }
      }
    }
    Thank you.

    Best Regards,
    Pearl

    Pearl

    Comment


    • #3
      Hello Pearl,

      I must have missed to change the index in line 63 while copy/pasting, this explains both led-digits reacting to one slider Thank you.

      I made a video of the blackout of the screen and attached it. I am pretty sure it is not a problem with the power supply since I have a 7,5V/5A power supply for the arduino.
      Attached Files

      Comment


      • #4

        Hi again Joshi,

        I’ve noticed that you have serial.print() commands in the loop function of your code, I suggest that you comment it out as it slows down the execution of the program and might also the reason why the screen shuts down.
        For you to be able to print the value of the sliders to the serial port, you can put the serial.print() command inside the myGenieEventHandler(void) function.

        Best Regards,
        Pearl
        Pearl

        Comment


        • #5
          Hi Pearl,

          yes I think this was the problem, since there a no blackouts anymore. Thanks a lot.

          Can you further help me with my project? I want to built a 4 Channel Voltmeter, with an alarm when exceeding the upper limits or falling below lower limit. So far one channel is working but I want to save the adjusted limits to the SD-card of the display and re-read it at startup. I read some appnotes but could't find one for visi-genie. Can you give me an example how to do it?

          Attached Files

          Comment


          • #6
            Hi Joshi,

            As you want to design your project in Visi-Genie environment, you can use the Visi-Genie Magic.
            On the other hand, this requires a PRO version of Workshop4, thus if your WS4 IDE is not yet in a PRO version, kindly visit the link below and also, you could try the seven day trial of it.
            https://www.4dsystems.com.au/product/4D_Workshop_4_IDE/

            Kindly refer to the links below for you to be guided in writing and reading data in SD card using Visi-Genie environment.

            https://www.4dsystems.com.au/appnote/4D-AN-00161/
            https://www.4dsystems.com.au/appnote/4D-AN-00163/
            https://www.4dsystems.com.au/appnote/4D-AN-00165/

            https://www.4dsystems.com.au/appnote/4D-AN-00164/
            https://www.4dsystems.com.au/appnote/4D-AN-00162/
            https://www.4dsystems.com.au/appnote/4D-AN-00166/

            Best Regards,
            Pearl
            Pearl

            Comment

            Working...
            X