Pages: [1]   Go Down
Author Topic: what happens if...  (Read 476 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Faraday Member
**
Karma: 30
Posts: 2524
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: 549
Posts: 27418
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
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.
Arduino for Teens available at Amazon.com.

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
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
Faraday Member
**
Karma: 30
Posts: 2524
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
Faraday Member
**
Karma: 48
Posts: 2935
...
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

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

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
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: 362
Posts: 17307
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
Jump to: