The Maker Show: Episode 2 - Blinking LED...Now What?

Sign in to queue

The Discussion

  • User profile image

    Another interesting video. I'd like to have known more about the potentiometer example, in what regards electricity. Why 50k, for example? or why is the value between 0-1024? Is this value arbitrary? And if the Led is analog, I assume 0-255 is a discretization of some voltage?

  • User profile image

    Nothing special about the 50k resistor (except it was what I had on hand when shooting the video). The analogRead will give you a values between 0 and 1023. This represents the a value from 0 to it's not entirely arbitrary. When the voltage is 0, the value is 0. When the voltage is 5v, you will have 1023. If you incorrectly connected this to a 3.3v pin, you would only get up to a value around 670 - 680.

    On the other hand, analogWrite only takes values between 0 and 255. 0 being always off and 255 being always on. Otherwise it is a pulse is at a regular frequency (depending on the speed of the pin). This is PWM. To be clear, the LED is digital. Connecting it to a PWM port allows you to blink it on and off in a frequency that is more off than on (less than 128) or more on than off (greater than 128) and allowing perception to take over on the "brightness" of the LED.

    A great place to read more about potentiometers and Arduino is here:


Add Your 2 Cents