MOVED: Arduino code doesn't work as expected, Seems to be a digitalWrite issue?

This topic has been moved to Programming Questions.
"Installation & Troubleshooting
For problems with Arduino itself, NOT your project "