Page 1 of 1

Handling Parameters

Posted: Mon Nov 20, 2017 6:34 pm
by biffboff
Hi i have a Python script sending some values from an external sensor over OSC.

How can i for example retrieve parameters within QLC. I want to send over RGB values from this sensor & then pick them up and set the RGB of my lights.

Thanks in advance!

Re: Handling Parameters

Posted: Tue Nov 21, 2017 4:14 pm
by biffboff
Ok I'm going to answer this myself. Rather cleverly QLC picks up on these. So i just need to map each slider & we're good!


Love QLC :)

apds.enableLightSensor()
oval = -1
red = -1
green = -1
blue = -1

while True:
sleep(0.25)
val = apds.readAmbientLight()
red = apds.readRedLight()
green = apds.readGreenLight()
blue= apds.readBlueLight()
print(red, ": ",blue, ":",green);
if val != oval:
oval = val
try:
target = liblo.Address(7700)
except liblo.AddressError, err:
print str(err)
sys.exit()

liblo.send(target, "green", green);
liblo.send(target, "red", red);
liblo.send(target, "blue", blue);

finally:
GPIO.cleanup()
print "Bye"