Youtube video

Arduino UNO

Breaboard

Breadboard wire

Potentiometer

10 led’s

eyy so let’s start

so at first we need to store the value of potentiometer we create an int called per

and in b is for (for)

first we need to set the pins 2 to 11 as output, we can do it with for is easier, as you see we start from 2 till 11, and it will set pin 2 till 11 as output

next in void loop

at first, we need to get our value, so the max ADC value (5V = 1023) is 1023, with some math we can get a value between 0 till 10

then we just turn on the LEDs which are needed to be on, and we turn others off

that’s all

How to build

What's ADC

An Analog to Digital Converter (ADC) is a very useful feature that converts an analog voltage on a pin to a digital number (most of the time 5V = 1023) .

What's for

The for statement is used to repeat a block of statements enclosed in curly braces. An increment counter is usually used to increment and terminate the loop.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments