I've been tinkering with the Stepper and LCD tutorials today. Some of the scripts use the same pins to drive the motor or LCD. As I switch between projects/sketches, I'll unplug the Arduino USB, pull the LCD circuit pin wires out, and hookup for the Stepper project on the pins/breadboard. However, when I plug the USB back in, it will still have the LCD sketch on it until I can upload the other Stepper sketch. Makes sense?!?
I can easily imagine a scenario where the Arduino is anticipating an OUTPUT but gets input from some component on the breadboard. Is there a risk to components or the Arduino itself with the sketch vs circuit mismatch?
Yes, there is the potential for damage due to sketch-vs-circuit mismatch. It's unlikely with an LCD shield and motor driver since they would both tend to receive signals from the Arduino, which might lead to a brief period of confusing behavior, but no damage. Worse would be if a shield had an output pin (input to the Arduino), and the sketch configured that pin as an output as well.
If you are disciplined, you can upload a "dummy sketch" into the Arduino whenever you switch shields:
setup() {} loop() {}
--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected