quick question

i have an Arduino Uno.and i have an LED conected to 5V pin and digital pin 13 a 220ohm resister is connected too, and i have a motor connected to vin pin which has 6V and conected to digital pin 12. but i cant figure out why the LED is connected to the 5V and motor conected to vin (6V)

this is not a problem about a code.im simply finding a reason why the LED and motor is connected that way.

i tried figuring out the current when 6V connected and current when 5V conected to see wheather any current passes the LED's maximum forward current(200mA) but it doesnt work current is less than 30mA when 6V is connected.

Does anyone smell smoke?

You’re going to damage pin 12 doing that. Have pin 12 control a transistor that then controls the motor current.

The LED/resistor to 5V and pin 13 will turn on the LED when pin 13 is low, if the LED anode is connected to 5V. If the cathode connects to 5V, there is no way to turn the LED on.

Draw a schematic and post a photo of it.
What are you doing with the circuit if you didn’t build it ?

i have a motor connected to vin pin which has 6V and conected to digital pin 12. but i cant figure out why the LED is connected to the 5V and motor conected to vin (6V)

this is not a problem about a code.im simply finding a reason why the LED and motor is connected that way.

I don't know why the motor is hooked-up that way either.... Who did that?

If the motor is connected directly (with no transistor or other driver circuit) it's wrong and there are two problems - There is a path for 6V through the motor to an I/O pin (exceeding the specs) and the motor and you'll get too much current through the I/O pin.

i tried figuring out the current when 6V connected and current when 5V conected to see wheather any current passes the LED's maximum forward current(200mA) but it doesnt work current is less than 30mA when 6V is connected.

What??? Did you measure the current?

The current from any one I/O pin cannot safely exceed 40mA. With 220 Ohms, you'll get about 14mA through the LED. With 5V and 220 Ohms is series with the motor, you should get about 23mA with almost all of the voltage dropped across the resistor and almost no voltage across the motor. So of course, the motor won't run.

this is not a problem about a code.im simply finding a reason why the LED and motor is connected that way.

Yes it is a problem. It is connected that way because you connected it that way.

This was designed by some one who knew very little about electronics. With a skill level so low that the only place to look good would be to put it on Instructables.

Your circuit is miswired !

Draw a schematic of how it is wired and post a photo of it. Post any information you have on the motor. (vendor link, markings on the motor etc) and a photo of the motor.

Your post is vague. Are you saying the led connected to pin 13 has a 220 ohm resistor in series ? That is correct wiring for the led. Nothing more to say about that .

This was designed by some one who knew very little about electronics. With a skill level so low that the only place to look good would be to put it on Instructables.

Aren’t you supposed to wait a couple of rounds before the KO ?