user-1: I'm trying to control the speed of two DC motors that are connected to a dual H bridge. I always used digital PWM pins with analogWrite() to change the speed, but since I'm making a project that will be using most of the digital pins, I wonder if I can use analog pins instead.
P.S. I know I can use analog pins as digital pins to free the digital PWM pins, but I'm not interested in doing that. 

user7937: No, you can't.  As it says in the Arduiuno reference page for analogWrite(): "The analogWrite function has nothing to do with the analog pins or the analogRead function."
You can use the "analog input pins" (A0..A5) of Arduino for analog input, or as digital inputs or outputs.  They cannot be used for PWM(digital)-output.  Only digital pins, and only those specifically stated for PWM-output, can actually be used for PWM output (unless you go down the path of software-PWM, though I would hesitate to do that for an H-bridge).

user4805: You can't do it with the analogWrite function as that is reliant on physical binding beween certain pins and hardware timers inside the AVR. But you can always use SoftPWM because the the analog pins can generally be used as digital pins just as well.

-1: <p>I'm trying to control the speed of two DC motors that are connected to a dual H bridge. I always used digital PWM pins with <code>analogWrite()</code> to change the speed, but since I'm making a project that will be using most of the digital pins, I wonder if I can use analog pins instead.</p>

<p>P.S. I know I can use analog pins as digital pins to free the digital PWM pins, but I'm not interested in doing that. </p>
 7937: <p>No, you can't.  As it says in the Arduiuno <a href="https://www.arduino.cc/en/Reference/AnalogWrite" rel="nofollow">reference page</a> for analogWrite(): "The analogWrite function has nothing to do with the analog pins or the analogRead function."</p>

<p>You can use the "analog input pins" (A0..A5) of Arduino for analog input, or as digital inputs or outputs.  They cannot be used for PWM(digital)-output.  Only digital pins, and only those specifically stated for PWM-output, can actually be used for PWM output (unless you go down the path of software-PWM, though I would hesitate to do that for an H-bridge).</p>
 4805: <p>You can't do it with the analogWrite function as that is reliant on physical binding beween certain pins and hardware timers inside the AVR. But you can always use <a href="https://www.pjrc.com/teensy/td_libs_SoftPWM.html" rel="nofollow">SoftPWM</a> because the the analog pins can generally be used as digital pins just as well.</p>
