Devices & Components
Male/Male Jumper Wires
Resistor 220 ohm
Potentiometer/ Finger Adjust Preset
LED (generic)
Project description
Code
Project Code
arduino
1#define LED_PIN 11 2#define POTENTIOMETER_PIN A1 3void setup() 4{ 5 pinMode(LED_PIN, OUTPUT); 6} 7void loop() 8{ 9 int potentiometerValue = analogRead(POTENTIOMETER_PIN); 10 int brightness = potentiometerValue / 4; 11 analogWrite(LED_PIN, brightness); 12}
Project Code
arduino
1#define LED_PIN 11 2#define POTENTIOMETER_PIN A1 3void setup() 4{ 5 6 pinMode(LED_PIN, OUTPUT); 7} 8void loop() 9{ 10 int potentiometerValue 11 = analogRead(POTENTIOMETER_PIN); 12 int brightness = potentiometerValue / 4; 13 14 analogWrite(LED_PIN, brightness); 15}
Downloadable files
Project Schematics
Project Schematics

Comments
Only logged in users can leave comments