Go Down

Topic: what happens if... (Read 514 times) previous topic - next topic

cjdelphi

Sep 17, 2012, 06:44 am Last Edit: Sep 17, 2012, 06:48 am by cjdelphi Reason: 1


if the ldr was connected 5v ~~~~ 1k ~~~~ ldr ~~~ A1  


does the voltage divider  no longer work? A1 should act as gnd no?

CrossRoads

A1 is not connected tho.
A0 might act as ground if you used
digitalWrite(D14, LOW);
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

westfw

Typically, an input pin (analog or digital) will NOT "act as ground"; inputs are almost an open-circuit.

cjdelphi

digitalWrite(A1, LOW);  //as suggested should do it though....


Turning the pins to low saves a lot of work using an extra pin :) - ok cool thanks

Docedison

Also would Guarantee the circuit operation... You would Know what state it was in... just by looking at the sketch.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

kf2qd

Okay - I'll ask - why do you want to use A1 (or A0) as a ground?

retrolefty


Okay - I'll ask - why do you want to use A1 (or A0) as a ground?


I can think of a few examples where one might want to use two output pins to drive a device. Say a two color led that activates one color or the other depending on direction of current flow, or simulate a third combined color be switching the two output pins at significant clocking speed. I've used a small 20ma single coil latching relay where I could select to set or reset the relay depending on current direction, or once set or reset I could place both outputs to the same state to allow for zero current consumption for the relay. There are other applications where it might be useful to 'power' a device via two output pins, it just has to have a maximum current draw less then the output pins are rated for.

Lefty

Go Up