This might be what you need to get started.
http://techni.caliti.es/blog/2008/12...ontroller.html