Announcement

Collapse
No announcement yet.

Addidng a touch functions to customdigits/LED digits

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

  • Vince_4D
    replied
    Greetings Mark,

    The file you mentioned is not applicable to achieve your objective but I made a workaround code that implements what you intended to do.
    The code utilizes "User Images" widget that is set to be touched.
    The widget contains 5 frames that can be manipulated by the display or by the Arduino.
    (Attached are the files needed for the implementation).

    Hope this will help.

    Best regards,
    Attached Files

    Leave a comment:


  • markl
    replied
    Vince,
    I have another question about changing button states. I think I would like to have a userButton that has multiple images, maybe 5, the first ones would be changed by touching the button but the other 3 states could be changed through visigenie code. Do you think this is possible. I saw an old thread that someone posted about this and the support staff gave him a revised P2 file. I tried substituting this and following the directions in the post, but my program won't compile with this file. I get multiple errors. Do you have any ideas?

    Thank you,

    Mark

    Leave a comment:


  • Vince_4D
    replied
    I’m glad that you were able to address the display problem.

    Most likely, your objective in using User LED as a button is also achievable if you are using the User Button.

    Have fun experimenting!

    Best regards,

    Leave a comment:


  • markl
    replied
    Hi Vince,
    Yes, I was able to implement the changes above, and it did work, however, it I pressed multiple buttons on after another, it would pause the display and sometimes required a power off/power on restart. So, I took your advice and used a User Button instead of an led, and it worked as expected. The display didn't freeze, so I guess that is the way I will go. The reason I was using the user led as a button was because I was stacking them on top of each other and using them as an indicator to show which output was on, or ready to start, etc., Because of limited space I wanted to use one of them as a button to indicate that it was in manual mode and not running automatically. I may be able to do the same thing if I can use the arduino to display the led mode changes on top of the button. I need to do some experimenting.

    Thank you,

    Mark

    Leave a comment:


  • Vince_4D
    replied
    Greetings Mark,

    Were you able to implement the ImageTouched := -1 as described in forum thread referred in post #3? If not, then most probably that is the reason why the display keeps resetting.

    Power issue may also be the cause of the reset. If the relay is being powered by the Arduino along with the display, there is a possibility that there is not enough power driving the display, hence, causes the reset. I would suggest that you try separating the power source of the display and the relay, this might fix the problem.

    You can provide us your project files (ViSi-Genie and Arduino) as well as your hardware setup for us to simulate on what you intended to do and hopefully offer you solution to the problem. If you don't want to share it on this thread, you can email it at vincent at 4dsystems dot com dot au.

    Also, may I ask why do you need to use the User LED to function as a button? I think it is much simpler if you use a User Button with ON and OFF images that looks like an LED. Doing so will simplify your code since button widget is already designed to be touched in ViSi-Genie, unlike User LED.
    Additional information about ViSi-Genie User Button can be found in this link https://www.4dsystems.com.au/appnote/4D-AN-00030/.

    Best regards,


    Leave a comment:


  • markl
    replied
    I have an issue with turning on multiple relays by touching the User_Led I set up to be a user button. I am using Visi Genie. The relay module is connected to the arduino Mega so that 8 pins can be set high and low by reporting changes to the state of the USER_LEDs. The problem is that if I push the buttons quickly it locks up the screen momentarily and sometimes the screen requires a power off/power on reset to respond. Here is my Magic Code:

    if (ImageTouched == iUserled15)
    LedFlag1 ^= 1;
    if (LedFlag1)
    PrintStrings (1, 1, 0);
    WriteObject(tUserled, 15, 1);
    SendReport(REPORT_EVENT,19,15,1);
    else
    PrintStrings (1, 13, 0);
    WriteObject(tUserled, 15, 0);
    SendReport(REPORT_EVENT,19,15,0);
    endif

    On the arduino:

    if (Event.reportObject.cmd == GENIE_REPORT_EVENT)
    {
    if (Event.reportObject.object == GENIE_OBJ_USER_LED)
    {
    if (Event.reportObject.index == 15)
    {
    if (genie.GetEventData(&Event) == 1)
    {
    digitalWrite(Relay_1, LOW);
    }
    else if (genie.GetEventData(&Event) == 0)
    {
    digitalWrite(Relay_1, HIGH);
    }
    }

    This code works fine if I push the buttons slowly, however the temp that is displayed on the screen goes blank for a second and then responds. If I press the buttons quickly, the relay responds but the screen needs a few seconds to reset before the temp is displayed again. I'm not sure if I am blocking the serial communication by turning the relays on and off, but that is what it seems like. Is there any way around this. I don't want to connect the relays to the display directly because of design limitations, but I might try it to see if it makes a difference.

    Your help would be appreciated.

    Regards,

    Mark

    Leave a comment:


  • Vince_4D
    replied
    No worries Mark. I'm glad it helped.
    If you encounter any problem in the future, feel free to notify us.

    Best regards,
    Vince

    Leave a comment:


  • markl
    replied
    Thank you for your help, that works beautifully.

    regards,

    Mark

    Leave a comment:


  • Vince_4D
    replied
    Hi Ameen and Mark, welcome to the forum.

    For enabling the touch of output widgets (i.e. LEDdigit, static texts, etc), kindly refer to this thread, https://forum.4dsystems.com.au/forum...ic-touch-query. If you have questions regarding with this thread, feel free to ask.

    With regards to activating other forms during start-up, you may set the initial form as shown in the image.

    Click image for larger version

Name:	Capture.PNG
Views:	116
Size:	14.8 KB
ID:	63678

    I hope this will help.

    Best regards,
    Vince

    Leave a comment:


  • markl
    replied
    I have a similar problem, I'm using visigenie with a 43DCT-CLB display connected to an arduino. I want to be able to touch a number and change its value with a slider. I have been able to make this work by creating a magic touch area defined by its x,y coordinates. I define a digit for the Magic Event, based on which area is touched, and that allows the trackbar to know which value to change. The problem is I can't disable it and if I touch the area in a different form it is still active. Any help would be appreciated.

    Leave a comment:


  • Ameene
    started a topic Addidng a touch functions to customdigits/LED digits

    Addidng a touch functions to customdigits/LED digits

    Hi,
    I am a newbie to this forum and 4D systems.
    My problem- I am working on project to turn on various devices and monitor output from various sensors. I have 8 forms. I am using the arduino as the host to read the data and control.
    I need to change the LED/custom digits using the keyboard example in form 2. Since digit is not having touch function is it possible to add a touch function. Since I have to set a lot of parameters this way. Is there a way to do this.
    Secondly, is it possible to change the default turn on form from form 0 to some other form.
    Please guide me through any help is appreciated. I am searching in dark please spread some light.
    Zip is attached
    Thanks
    Ameen
    Attached Files
Working...
X