Check for the driving impedance requirement of any A/D inputs.
According to the datasheet, ATmega32u4's analog inputs can handle 10kOhm, yes.
However, I personally am not going to include analog input in the tutorial. For correctly sampling any input signal, one would need to low-pass filter it, and that would require much more explanation. I intend to focus on the gadget-computer interface, and how to create utilities and tools, in Linux, that interface with such gadgets. I chose ATmega32u4, because I'm familiar with it, and I like its native USB interface. In the tutorial, the gadget itself will be basically as simple as I can get away with.
The choice isn’t arbitrary. You have to mind the data sheet’s specs on the pins’ drive capability.
Of course. The resistor choices are a bit arbitrary in the sense that there is a wide range of values that work well and safely. I have not fixed my choice to those particular resistors yet, but I wanted the illustration to have something sensible to start with. (ATmega32u4's pins can sink and source 20 mA at 5V, 10 mA at 3V, but there is also a 100 mA sum limit on certain sets of pins.)
Use a low-current LED and use it to monitor the I/O pin; this lets you keep your I/O functions.
Good idea! It had not even occurred to me to try something like that.
I'm tempted to create a carrier board, with a socket for a Pro Micro/Leonardo clone, that simply incorporates a bunch of those LEDs and their resistors, for safe experimentation on a breadboard. Not necessarily for all I/O pins, but maybe a dozen or so. If it spanned the gap between two breadboards (instead of straddling the center of one), it might be even more useful.
I am also thinking about using a small OLED display (I
2C) instead of, or in addition to, the LEDs. They're cheap, easily available, and it makes more sense wrt. my actual objective (how to create Linux programs to interface to USB gadgets) - definitely much more exiting than just blinking LEDs, although there is more programming effort involved.
I do intend to explain all of this in the tutorial, probably in two levels. (That is, with an optional in-depth explanation, while the main text simply explains the ranges and choices made.)