Parts
![15 00:10.jpg](/proxy/?url=https://content.instructables.com/FN9/R0UB/IBQCG77H/FN9R0UBIBQCG77H.jpg&filename=15 00:10.jpg)
-Arduino board
-LED
-Potentiometer
Simply connect the longer leg of your LED to pin 5 of your Arduino and the short leg to GND, connect the potentiometer to GND and +5V and the ADJ to any analog pin on your Arduino board.
-LED
-Potentiometer
Simply connect the longer leg of your LED to pin 5 of your Arduino and the short leg to GND, connect the potentiometer to GND and +5V and the ADJ to any analog pin on your Arduino board.
Code
![5599ae834936d47460000498.jpeg](/proxy/?url=https://content.instructables.com/FYA/33SR/IBQCGLXR/FYA33SRIBQCGLXR.jpg&filename=5599ae834936d47460000498.jpeg)
![15 00:10.jpg](/proxy/?url=https://content.instructables.com/FHD/65EQ/IBQCG77D/FHD65EQIBQCG77D.jpg&filename=15 00:10.jpg)
![15 00:10.jpg](/proxy/?url=https://content.instructables.com/FTQ/4S7T/IBQCG77C/FTQ4S7TIBQCG77C.jpg&filename=15 00:10.jpg)
int led=5;
const int hold=10;
void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
}
void loop()
{
int value=analogRead(A5);
value=map(value,0,1023,0,255);
if(A5 > hold)
{
analogWrite(led, value);
Serial.println(value);
delay(10);
}
// put your main code here, to run repeatedly:
}
Thanks for your time. If you have any questions please leave them as comments.