Hi everybody, first of all I’m french and new in the world of Arduino so forgive me for all my possible mistakes…
I would like to make a simple program: I would like to connect a LED (the on-board LED in fact) and a phototransistor to an Arduino Nano, and when the ambient light is hitting the phototransistor, nothing happens. But when I put light on the phototransistor (such as laser light for example), I’d like the the on-board LED to light.
So I begin for example with:
int ledPin=13; // The LED is connected to digital pin 13
int photoPin=7; // The phototransistor is connected to digital pin 7
But I don’t know exactly what writting in the void loop…
Moreover, if you could give an advice on the value of the resistor to use in order to make it easy, it would be great!
Thanks a lot.