This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

counting script with rgbw
#1
Dear readers,

A customer of ours wants the following:
There is a knx motion detector on a toilet.
The toilet contains RGBW spotlights controlled by a Zennio x4
Now there must be a sequence that shows the same color 9 times and this must be adjustable yourself.
and the 10th time there must be a random rgbw disco light.
where the speed can be adjusted.
and after the 10th time a reset so that everything starts again from the beginning.

Does anyone have experience with this script?

yours sincerely
Reply
#2
What is a disco light? A random color or what?
------------------------------
Ctrl+F5
Reply
#3
That is a loop of different colors that appear irregularly
Reply
#4
Random RGBW value example: https://forum.logicmachine.net/showthrea...7#pid24187
Reply
#5
And how can I create a counter and have a reset to 0 when I pass 10?
Reply
#6
This will write a random RGBW value 10 times with 1 second delay between each write:
Code:
math.randomseed(os.time())

for i = 1, 10 do
  r = math.random(0, 255)
  g = math.random(0, 255)
  b = math.random(0, 255)
  w = math.random(0, 255)

  rgbw = r * 0x1000000 + g * 0x10000 + b * 0x100 + w

  grp.write('1/1/13', rgbw)

  os.sleep(1)
end
Reply


Forum Jump: