Maintenance notice: These forum archives are read-only, and will be removed shortly. Please visit our forums at their new location, https://www.evilmadscientist.com/forums/.

Alpha clock 5: adding a photo resistor

edited August 2013 in Clock Kits
Hi

This is my first Arduino based project I'm doing. I'm a very experienced programmer but a lousy electronics engineer.

My idea is to add a photo resistor to the clock so the brightness gets adjusted to actual amount of ambient light.

My question is: Is it as simple is this ?

Add a photo resistor like this to PA5 or PA7 with the following schematic:

----------------------------------------------------

PhotoR 10K
+5 o---/\/\/--.--/\/\/---o GND
|
Pin PA5 o-----------

----------------------------------------------------

( found on http://playground.arduino.cc/Learning/PhotoResistor )

And than read it with analogRead(4) or analogRead(6) in the code ?


Thanks for any help,
Jankoen

Comments

  • This sounds mostly correct, but I think that PA5 is mapped to Analog 5.

    Those analog pins were left open specifically so that you can do projects like these; it sounds like a fine approach.
Sign In or Register to comment.