Try looking at an example in the Arduino IDE: File>Examples>01.Basics>Blink or File>Examples>10.StarterKit>p02_SpaceshipInterface. One of the beginning projects in the Arduino book that comes with the starter kit guides you through an example just like what you are trying to do. There is definitely something wrong with your code, but I don't have my Uno board with me to figure it out. Keep trying!