Project #3 for() loop mystery

Do you have the LED in the correct orientation and connected correctly?

As far as I read on the digitalWrite-function (and as far as I remeber 8)) it does depend here what you are trying to achieve.

Case 1: The LED has one side (anode side) connected to 5V and the other side (cathode) connected to "pinNumber". In that case the code is correct. It looks strange but the arduino does not need to read from the pin so it is an OUTPUT, which is in turn pulled LOW, so to 0 volt.

Case 2: The LED is has one side connected to GND (cathode side) and the other side (anode) is connected to "pinNumber". In this case, you want it to be OUTPUT and HIGH as is has to supply 5V to the LED.

Case 2 is the preferred, or most used, config. Let is know how your getting on.