don't be silly, you can do anything in any language you like. You could do it in visual basic if you wanted. You have to interface with a device driver, or you can write directly to some output address if you want. If you on a linux host open a correctly mapped "/dev/something" device and write to it, but you'll have to write something the hardware understands... it's your light bulb that must be hooked to some kind of addressible variable resistor that will adjust it's brightness based on some digital signal, or the contents of some buffer. In order for an 'address' to make a difference, it has to be using Memory mapped I/O, so if for example you're using the serial port, and you have a controller on the serial port between your machine and the light bulb, you can open up the port's /dev/ttySx device and send data to it... but you cannot hook up just a device that doesn't have any controller to accept digital signals as valid input and expect to control it no matter what device you're working with. In windows, use the win32 api to write to the serial port using, of all things, the serial driver, and in linux, open the device and fire away. It has nothing to do with the language at all.