Switching between sketches/projects

Likely a rookie question here....

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?

Risk, Yes.

Suggest you upload new sketch before hooking up the new connections.

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

Thanks for the super fast replies. I like both of those strategies.

For others following this thread in the future, the dummy sketch needs to be this (added the VOID keywords):

// Dummy sketch to avoid any sketch vs circuit mismatch.  
// Use to protect your arduino when switching projects

void setup() {} 
void loop() {}

The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

Excellent product! Like it 8)

Or just untach the wires, upload, unplug then wire new