In my loop I have something like:
if (reading == idleVal) motorIdle();
and then that function is:
void motorIdle(){ //turn off motor
digitalWrite(motorUpPin, LOW); //motor is not going up
digitalWrite(motorDownPin, LOW); //or down
}
...it's going to be idle most of the time in real life. Does that matter that it continually keeps setting the pin low??? If it's low, it's low, ...it won't hurt anything will it?
Makes no difference to the processor or any hardware. Often that's as good a way as any because it saves extra logic although it does go against the grain a little I admit.
MarkT:
Or put another way, electrons don't wear out!
Yea. electrons are the only moving parts in a AVR chip.
OT, but also any one specific electron is pretty slow poke. An instructor once explained that while the electron current flow through a conductor is near or at the speed of light, a specific given electron may take years to travel from one end of a 12" wire to the other. Not sure about the year part (I'm old now!), but it was of a duration that made my jaw drop as I slowly got an appreciation of how many damn electrons are in a 12" 22 gauge piece of copper wire.
Thanks. I know I've read something about only writing some many times to the EEPROM, and there's no moving parts in there is there? I'm sure there's a big difference so how.
SouthernAtHeart:
Thanks. I know I've read something about only writing some many times to the EEPROM, and there's no moving parts in there is there? I'm sure there's a big difference so how.
Well yes, it was a glib statement - most electronic devices only have electrons moving.
An EEPROM involves programming with high voltage gradients to force (well, quantum-tunnel) electrons through an oxide insulator -
this stresses the insulating layer and leaves electrons trapped in flaws in the oxide, these build up and eventually cause
mis-behaviour of memory cells - so technically the electrons don't wear out but the flaws in the insulator allow degradation
of the device in this manner.
Electronic devices also age (the material isn't stable long-term), suffer from thermal cycling (causes mechanical stresses),
and various effects, but in general should stay reliable if kept below "absolute maximum ratings".
My colleagues and I once tested a microprocessor controlled device. We used softwate loops to test every system there were. One of the parts/systems was a flashrom to store some settings. We left the loop running and went to have a coffee break. After the break the chip was broken. It took some time before we understood what was wrong.