<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/FyBjt5KYyZ8&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/FyBjt5KYyZ8&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object>
The RGB Controller
The controller I used is from a Vogel's Moodvision XLF200 set. These real nice looking, very intense LED lighting tubes are available in 2 versions. There is a button controlled version (XLF200) and a remote controlled version (XLF300). Extra LED tubes are available in the XLF100 package. I used the XLF200 controller with a nice blue button.
Hacking the controller
I wanted to be able to make any color and not only simulate button presses with my Wiimote. So I had to modify the controller a bit. It's rather easy to open the controller. Inside is a microcontroller, some fet's that drive the LEDs and a switch. I wanted to talk to this controller by RS232 so I soldered a SUB-D9 connector to the TDO and RDI pins of the micro. Picture below:
Bluetooth Dongle
On the PC I attached a cheap USB Bluetooth dongle that I bought in China. It comes with a free version of the Blue Soleil bluetooth stack.
I paired my Wiimote with my PC. This is done by holding down the 1 and 2 button on the Wiimote (leds will flash) and use the bluetooth software to set op a connection with a HID device.
GlovePIE
There are several free programs on the internet that make it possible to interface your Wiimote with PC applications. I used a program called GlovePIE. It takes some time to understand the functions of the program because the documentation seems to be written for people that already know GlovePIE. Also the copyright disclaimer is really strange. But after investing some time to learn the functions of the programm and going through many examples and forums on the internet I found it one of the best solutions currently available. Actually real good solutions do not yet exists.
GlovePIE has no function to send messages to a RS232 port. So there my Visual Basic skills came in handy again. I made a small programm that translated Winsock data to the serialport. I made a GlovePIE script that uses the OSC (Open Sound Control) labraries. This is no more than simple winsock messages.
This is the my GlovePIE script:
ExitScript = HeldDown(Wiimote.Home, 3s)
var.broadcast = false
var.ip = "localhost"
var.port= 51345
// roll to select color
// pitch not yet used
// values from -90 to 90
var.N = wiimote1.smoothpitch
var.M = wiimote1.smoothRoll
debug = var.N + " " + var.M
// Red
if ((var.N >= -90) && (var.N <30> 30) && (var.N <90> -90) && (var.N <30>= -30) && (var.N <30> -30) && (var.N <30>= 30) && (var.N < 90))
var.strB = (255*(var.N - 30))/60
else
var.strB = 255;
endif
//debug = var.N + " " + str(var.strR) + " " + str(var.strG) + " " + str(var.strB)
var.strR=chr(var.strR)
var.strG=chr(var.strG)
var.strB=chr(var.strB)
//if wiimote.a then
sendosc(var.ip, var.port, "serial", "C"+ var.strR + var.strG + var.strB + chr(0xff))
So the GlovePIE script sends winsock messages to a visual basic program that sends RS232 messages to the Moodvision controller.
Color Algorithm
I have been playing with many different color algorithms to get the best results. Interesting was the version in which a had defined 3D area's in which one discrete color was active. I ended with the version shown here. Basically I split the range from -90 degrees to +90 degrees in 3 sections. In section 1 green goes from 0 to 255. In section 2 green goes from 255 to 0 and blue goes from 0 to 255. In section 3 blue goes from 255 to 0 and red from 0 to 255. This way I could make any color and also have smooth transitions between them.
Fuente: wii.hasse.nl















