Pages: [1]   Go Down
Author Topic: When to write pin high/low?  (Read 263 times)
0 Members and 1 Guest are viewing this topic.
Portland, Oregon, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 39
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
Edison Member
*
Karma: 52
Posts: 2298
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you only write to change its state.

Mark
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 146
Posts: 5500
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

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13705
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 -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: