def setup_light(name, thread): for color in ('r', 'g', 'b', 'w'): inSig = hal.newsig('%s-%s' % (name, color), hal.HAL_FLOAT) outSig = hal.newsig('%s-%s-out' % (name, color), hal.HAL_FLOAT) ledDim = rt.newinst('led_dim', 'led-dim.%s-%s' % (name, color)) hal.addf(ledDim.name, thread) ledDim.pin('in').link(inSig) ledDim.pin('out').link(outSig) rcomps.create_light_rcomp(name) storage.setup_light_storage(name) motion.setup_light_io(name)