Hello,
A friend of mine sent me this link http://www.arduino.cc/ knowing I am building a simulator. I decided to post it here assuming simbuilders might find it useful for something like switching.
I don't have the vaguest idea how these things work or how they are programmed. There is a link that shows how to build them by hand too. Hope it helps.
Regards,
ermias