0

Added variables into one single UPD command

Hi out there...

Actually I am trying to get something working with Bright Author and the HS123 board (similar to the HD1023):

It should be a colour selection for a connected smart home device that uses UDP commands for changing light colours. So I want to create a JPG with three colour areas, let's say red, green and blue. The easy way would be to send out at UPD command via touch event, but I want to keep the selected colour in a variable, in case the user switches to another state. If the user gets back into the colour selection, then the colour must be shown as active. So I could use the live text to show the value of the variable, so far so good.

But now I want to mix the colours, maybe yellow with 100% red and 100% green. Therefore I would need to add the stored values of the variables.

Example:
Colour red gets the variable "var_red" and the first value is 0. If somebody touches the red area again, the variable increases. Somewhen it will have a value of 50%, now the user wants to add green color. So I would take "var_green" for this, and the same procedure will be working. But now there is my problem: How can I create a UPD command out of all three variables?

Wenn I combine all variables I could send something like a DMX value, but this needs to have all three variables together, like 255255000 (means 100% red, 100% green, 0% blue).

Is somebody here who could help me with this?

1 comment

  • 0
    Avatar
    Bright Scripters

    This should work

    $$var_red$$$$var_green$$$$var_blue$$

     

     

Please sign in to leave a comment.