Arduino Forum

Using Arduino => Programming Questions => Topic started by: Riccarr on Nov 22, 2012, 08:04 pm

Title: When to write pin high/low?
Post by: Riccarr on Nov 22, 2012, 08:04 pm
Hello

Basic question.

During the course of looping my program and performing digitalWrites to pins, if I write a HIGH to a pin so that it turns on a transistor, do I need to keep writing HIGH each time through loop to maintain the pin in its HIGH state thus keeping the transistor switched on?

Or do I need to only write to the pin when I want to change its state?

Thanks
Eric

Title: Re: When to write pin high/low?
Post by: holmes4 on Nov 22, 2012, 08:06 pm
you only write to change its state.

Mark
Title: Re: When to write pin high/low?
Post by: fungus on Nov 22, 2012, 08:09 pm

During the course of looping my program and performing digitalWrites to pins, if I write a HIGH to a pin so that it turns on a transistor, do I need to keep writing HIGH each time through loop to maintain the pin in its HIGH state thus keeping the transistor switched on?


No.
Title: Re: When to write pin high/low?
Post by: robtillaart on Nov 22, 2012, 08:19 pm
but it doesn't hurt either - except for a few CPU cycles burned