Thanks to @ceejay, here’s some code to set up serial parameters and read from the serial device. Bizarrely the usual method stopped working after an update. #!/usr/bin/perl
use strict;
use warnings;
use Device::SerialPort;
my $serport="/dev/ttyUSB0";
my $dev = tie (*SERIAL, 'Device::SerialPort', $serport) || die "Can't tie: $!";
In the struggle to find more cool things to do with the arduino, I thought I’d do what someone on twitter had done, make an “Ambilight”, an ambient light behind your TV that colours whatever is behind your TV the same colour as the average colour on your screen – pretty cool! Some Philips TV have this, but I’m not willing to spend extra on that (and I have a TV). I read Szymon Kobalczyk’s Blog and thought I’d give it a whirl. Currently I’m using one of my existing BlinkMs, but I’ve ordered two RGB LED strips and the necessary (hopefully) components from farnell.
The core idea is:
Run “Boblightd”, which monitors the screen (excuse the pun) and calculates the average colour, passing it to a program that sends the message via serial to…
An arduino listening for colours, and changes the colour of the BlinkM/RGB LED strip accordingly
This is the result of mine on my computer monitor, looks much better in real life (skip to 30-40s for best demo). Will be even better when the RGB LED strip arrives – that’ll be going behind my 42″ TV downstairs.