AmbientLight

Light. Colored. Times Three.

// There are virtual Orbs in this help Directory listening to NetAddr.localAddr:

(Document.current.path.dirname ++ "/VirtualOrb.rtf").load

*new(serial)

create new instance

set(which(0), color(Color.black), dt(0), action)

set the color of an ambient orb.

which the number of the light, may also be an array of indices

color the color to be set

dt time passing until color is set

action evaluated after color is set

Examples

SerialPort.devicePattern = "/dev/tty.usbserial*"; // osx usb serial (I hope it's a standard)

SerialPort.devices;

(

p = SerialPort(

SerialPort.devices.first,

baudrate: 115200,

crtscts: true

);

)

o = AmbientLight.new(p)

o.set([0,1, 2], Color.yellow)

o.set(0, Color.green)

o.set([0, 1], Color.red)

o.set

o.set([0, 1, 2], {Color.green*1.0.rand}!3)

o.set(2, {Color.blue}!3)

o.set([0, 1, 2], {Color.red}!3)

o.set([2], {Color.red}!3)

o.set([0, 1, 2], Color.black)

SerialPort.closeAll