bakingpi-www icon indicating copy to clipboard operation
bakingpi-www copied to clipboard

"OK" LED is 17th GPIO pin

Open muellermartin opened this issue 9 years ago • 2 comments

I think there is an off by one error in the naming of the OK LED: Since lesson OK01 the "OK" LED is decribed to be the 16th pin, but now I'm pretty sure it actually is the 17th pin, because the GPIO pin numbering starts at zero and of course by looking at all the offsets for setting the GPIO function and the output. The pin is referred to as "GPIO16" but there is also a "GPIO0" pin.

muellermartin avatar Apr 21 '15 19:04 muellermartin

Hmm, this is an interesting one. The debate here is, is the GPIO0 pin the "first (1st)" pin or the "0th" pin. Looking at my descriptions, I also talk about the 16th bit in a register, which implies I have a 0th bit. Perhaps it's worth a clarifying comment to be explicit about what I mean. Alternatively it could be rewritten to say "pin 16" and "bit position 16" with a note somewhere saying that "pin 0 is the first pin". It may even be a nice opportunity to describe off by one errors :wink:

Chadderz121 avatar Apr 22 '15 08:04 Chadderz121

Yes, definitively! I have a programming background, so I'm somewhat used to count from zero, but I guess it can be difficult for newcommers. I like the idea to use different naming "pin 16" vs. "bit position 16" (although this still is ambigous if there was no prior notice whether there is also a 0th bit/pin). Maybe this can be underlined with an indicator (color, symbol, etc.) to always make clear which counting method is used and a box explaining the meaning of the indicators. It could be quite useful to explain the off-by-one error, e.g. in the troubleshooting section.

muellermartin avatar Apr 22 '15 10:04 muellermartin