BrianBot:
BenF:
You need to check your port to pin assignments. In Arduino land, PD1 is digital pin 1 and PD4 is digital pin 4 (rather than the physical package pins 5 and 6 as used in your sketch).Here's the full list for AtMega 168/328:
Yes, you were very much correct; the problem was my pins. apparently when declaring:
pinMode(5, OUTPUT);
the 5 refers to PD5 and not pin 5.I'm shocked I made it this far without knowing this. Perhaps I did know it in the past and am just too stupid to remember. Either way, thank you very much for the help.
Glad you sorted it out, but I wasn't aware that the labels on the diagram had anything to do with the code; from your description, you seemed fairly confident it was the code, not the hardware, so I made the (wrong) assumption that your code was configure properly for the hardware, and the hardware was hooked up properly. Hmm - next time you post something like this, you should post your -entire- schematic (all parts and connections) included, along with your complete code (which you did); it would save all of us time.