Target : Threshold detection of an analog signal
How : The LED is connected to the digital output No. 13 , the program detect a threshold analog signal connected an input analog pin A0.If the signal level is above the threshold, the LED is illuminated.
Wiring : same wiring for the LED. The trimmer is powered by the voltage source Arduino board
Technology : Acenter
pin of the potar provided a dependent variable voltage the position of the
axis of the trimmer, this pin is connect an input analog pin A0.The program
read a value from this analog pin.
Soft :The goal is to
turn ON or OFF the LED under the following conditions: If A0> 2.5V while
we light the LED, If you turn OFF the LED. analogRead(pin)
Reads the value from the specified analog pin. This function return integer
values between 0 (0V) and 1023 (5V). If
(condition) then else : if, which is used in conjunction with a comparison
operator, tests whether a certain condition
has been reached
Components : led, Resistor 220Ohms, trimmer