The IR code is configured for use with a Sony TV, the library is courtesy of http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html
I also took some IR codes for the TV from here: http://www.openremote.org/pages/viewpage.action?pageId=15532260
Everything else uses the built in Arduino functions and libraries or my own work.
Step 1: Materials
1. An Arduino UNO.
2. An HC-SR04 ultrasonic module
3. An Infra-red LED
4. An appropriate resistor for your Infra-red LED (I used 220R but the signal is quite weak!)
5. An RGB LED (and resistors if they aren't built in).
6. A breadboard and wires.