jerseyguy1996:
I remember from coding on AVR Studio that this was appropriate because you want to initialize the pins to a known state before exposing them by setting the data direction register. However, it wasn't working on the arduino so I posted a question on this forum and received a reply that suggested that pinMode initializes the pins to LOW regardless of the state that they were in prior to calling pinMode. It is under reply #1 on this thread:Am I still missing something?
I've checked the Arduiono 1.01 pinMode() code. It does not write to the data register when you set the mode to OUTPUT. So it is safe to set the state before setting the pin mode to OUTPUT. I have been doing this in my own programs for some time.
jerseyguy1996:
I have just started noticing the println(F(...)). Is this just an alternative to using PROGMEM....not that I have ever even used it? I could be way off here.
Yes, it's an easy way of using PROGMEM to hold string literals that are used only as arguments to print() and println() functions.