#loop array cycle on trigger event

1 messages · Page 1 of 1 (latest)

gaunt bane
#

Hi I want to fillup x,y coordinates to array and on trigger event pull one next event next pair , in a last record step back index the first elemet Im begginer but lear fast and I have basic knowledge

icy gazelle
#

You reaaaally need to explain more. What coordinates ? What do you want to do with them? Where do you want them to go or be stored? Pull one out?

gaunt bane
# icy gazelle You reaaaally need to explain more. What coordinates ? What do you want to do wi...

Ok I try it 🙂

  • The task: define array with about 10 elements (one element is x,y value pair) store in inject node???
  • In trigger action (next or previous ) pull next or previous element from
    array and construct {"color": {"x": x_value, "y": y_value}} payload data
  • Send this data to light bulb
  • after last element on next trigger event array index go to first and pull it
  • after first element previous trigger event array index go to last and pull it (cycling in array)
    trigger even come from switch node legs 6 and 7