Code: Select all
pinMode(_yp, INPUT);
pinMode(_ym, INPUT);
digitalWrite(_yp, LOW);
digitalWrite(_ym, LOW);
Is it possible to make a pin OUTPUT while ensuring its initial value. For example, I want to change a pin to OUTPUT,
but I don't want any spurious spikes. So suppose I have
Code: Select all
pinMode(pin, INPUT_PULLUP);
...
pinMode(pin, OUTPUT);
// How can I avoid an unintended low or undefined value happening here? Can I set the pin value before
// I make it OUTPUT?
digitalWrite(pin, HIGH);
Thanks
Peter