Planning to use a pot as a variable resistor on Arduino

I am planning to use a potentiometer as a variable resistor between arduino and a led to control the brightness of it, without putting a resistor between the led and arduino (I will use the middle pin and right pin of the pot in other words). Is it bad for arduino?

compnaion:
Is it bad for arduino?

There's a risk of taking the resistance too low (to 0, in fact), and having too large a current. I would still use an inline fixed resistor so that there's limited current even when the variable resistor is at 0.

Or at least somehow physically prevent the pot from being turned lower than a couple of hundred ohms.

A wiser solution I'd say, is to wire the pot to an analog input and the led to a pwm pin, with resistor. Then analogRead() the pot, and divide that by 4 on the way to an analogWrite().

juma_yetu:
There's a risk of taking the resistance too low (to 0, in fact), and having too large a current. I would still use an inline fixed resistor so that there's limited current even when the variable resistor is at 0.

Or at least somehow physically prevent the pot from being turned lower than a couple of hundred ohms.

I have 22k pot, I won't turn it more then half, this will help, I guess

juma_yetu:
A wiser solution I'd say, is to wire the pot to an analog input and the led to a pwm pin, with resistor. Then analogRead() the pot, and divide that by 4 on the way to an analogWrite().

Why I am doing this actually, I don't have resistors, and only need I have for leds is to learn somethings on arduino, trying some codes etc. Other than that I have no use for resistor, thus I don't want to bother with getting one.

Other than that I have no use for resistor, thus I don't want to bother with getting one.

If you can't be bothered getting a $0.01 resistor then I suggest that this hobby is not for you.

I will use the middle pin and right pin of the pot in other words). Is it bad for arduino?

The biggest danger is to the pot. Using a very small section of the track will burn out the pot.

compnaion:
I have 22k pot, I won't turn it more then half, this will help, I guess

You say that now, but that's really cr@p engineering.

One day you'll forget, or turn it the wrong direction, and poof will go the pin of the Arduino.

22k is way too high for an LED on 5V. You are going to have to use the bottom 1-2% of the range of the pot.

That focuses all of the heating into that one small part of the pot's resistive strip and it will be toasted, even if you somehow never accidentally hit 0%, which cooks everything else.

If you want to learn anything, you best first learn that you should buy a set of resistors. A lifetime supply is just a few dollars.

Resistors are so cheap , buy a pack of 10 off 270ohm and these will suit driving LED’s.

If you make an error with your pot and destroy your Arduino it won’t be cheap.