RGB Fading

Discussion in 'Pascal Logic Code Examples' started by Mike Costello, Feb 15, 2016.

  1. Mike Costello

    Mike Costello

    Joined:
    Dec 9, 2013
    Messages:
    47
    Likes Received:
    0
    Location:
    UK
    Hi,

    I've got a client with a RGB chandelier.

    I'm using a CBus DMX controller to control the colours and have it set on an EDLT with the Red, Green, Blue sliders so the customer can adjust the percentages to make whichever colour they choose.

    However they also now want to be able to press a button so it will fade through the colours at a set speed. As this can be done on a cheap LED kit you buy off Ebay I need to find a way to do it with CBus.

    I'm guessing it needs logic to do and there's a Wiser 2 installed.

    Please help!!

    Thanks
    Mike
     
    Mike Costello, Feb 15, 2016
    #1
    1. Advertisements

  2. Mike Costello

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,142
    Likes Received:
    118
    Location:
    Adelaide, Australia
    I posted some logic to do HSV to RGB conversion some time ago.

    You will find it here:

    http://www.cbusforums.com/forums/showthread.php?t=8657

    All you have to do is change the H value while leaving the S and V constant. What I have done is have 2 sliders to set the S (saturation) and V (value or brightness) then change the H value in a 0 -359 loop. Because logic runs every 200mS, if you increment the H value each time it will cycle through all the colours about every 50 seconds. You can speed it up by incrementing by more than 1 each scan, but will will soon start to seem obvious jumps. To get smooth higher speed changes I ended up building my own hardware.
     
    Ashley, Feb 15, 2016
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.