B4R Question What is the difference between Analog pins and digital pwm pins when we use Analog write?

vali khandangoll

Active Member
hi
What is the difference between Analog pins and digital pwm pins when we use Analog write?

I want to use a DC motor with Arduino.
when DC motor connect to Analog pins my DC motor start in analogwrite(120) suddenly and i can not change DC motor speed.
but
when DC motor connect to Digial pwm pins Dc motor start from analogwrite(2) slowly and i can change DC motor speed.
 

teddybear

Well-Known Member
Licensed User
What mcu do you use? not all of the analog pins can be used as digital pins, you'd better read the document of the mcu.
 
Last edited:
Upvote 0

embedded

Active Member
Licensed User
Longtime User
Motor must be connected to PWM pins. Analog Pin used to measure analog voltage i.e it act as input pin. Pwm Pins Act as OUTPUT Pins which can generate analog voltage to its output...which control the current ...so that we can control intensity of light or speed of motor.
 
Upvote 0

vali khandangoll

Active Member
What mcu do you use? not all of the analog pins can be used as digital pins, you'd better read the document of the mcu.
thanks.
ٍErl and embedded explanation was sufficient and useful.
I do not use analog pins use as digital pins rather the opposite

not all of the analog pins can be used as digital pins,
 
Upvote 0

embedded

Active Member
Licensed User
Longtime User
thanks.
ٍErl and embedded explanation was sufficient and useful.
I do not use analog pins use as digital pins rather the opposite

not all of the analog pins can be used as digital pins,
Generally all analog pins can be used as digital pins....but there are two class of digital pin ...as input or output....some digital pins can be used as inputs only. digital output is restricted. datasheet is very useful in this case
 
Upvote 0
Top