code compiling, but will not actually work

Do you know if your Serial monitor (the terminal itself) is set to 9600 baud?