Loading...
Pages: [1]   Go Down
Author Topic: what happens if...  (Read 319 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
God Member
*****
Karma: 10
Posts: 957
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



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


does the voltage divider  no longer work? A1 should act as gnd no?
« Last Edit: September 16, 2012, 11:48:01 pm by cjdelphi » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 270
Posts: 17051
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A1 is not connected tho.
A0 might act as ground if you used
digitalWrite(D14, LOW);
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

SF Bay Area (USA)
Offline Offline
Faraday Member
**
Karma: 80
Posts: 5513
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
God Member
*****
Karma: 10
Posts: 957
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


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

Anaheim CA.
Offline Offline
Edison Member
*
Karma: 34
Posts: 2405
Experienced old Whitebeard with a Full head of Hair...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Doc
Logged

“The solution of every problem is another problem.” -Johann Wolfgang von Goethe

South Texas
Offline Offline
God Member
*****
Karma: 8
Posts: 978
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 283
Posts: 15443
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Print
 
Jump to: