Loading...
Pages: [1]   Go Down
Author Topic: When to write pin high/low?  (Read 109 times)
0 Members and 1 Guest are viewing this topic.
Portland, Oregon, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Poole, Dorset, UK
Offline Offline
God Member
*****
Karma: 8
Posts: 671
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you only write to change its state.

Mark
Logged

Valencia, Spain
Offline Offline
Edison Member
*
Karma: 65
Posts: 2246
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Netherlands
Offline Offline
Tesla Member
***
Karma: 89
Posts: 9393
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

but it doesn't hurt either - except for a few CPU cycles burned
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Pages: [1]   Go Up
Print
 
Jump to: