I think I'll go back to the flashing LED program and get that working, then gradually introduce the rest of the code with that, and see which part of the code interferes with the pin output.
It's such a waste of time programming these chips when I have designed an application that does all that without commas and tittles, and without any knowledge of programming at all. An application that anyone can use, all they need is the idea, then the rest is a piece of cake. Let computers write the computer language, they're supposed to be so smart.