It'd be helpful to look in playground first: http://arduino.cc/playground/Main/InterfacingWithHardware#Output "cube"