Motor speed with nodemcu V3

I am using Nodemcu V3 see link. It is a 3V3 board
I wired it to a SN754410NE chip to control a 12V toy motor. I am actually powering the motor with 9V because it is too fast for my project.
I use the code in this link Code after modifying it to match my pins. I use pins D7 and D8 for the motor and D5 for the speed. The problem is, with D5 connected I hear a faint buzz from the motor and it doesn't spin. When I remove it, it runs like charm. I am confused about having the line

analogWrite(speedPin, speed_value_motor1);

The speed pin is a digital pin even in the example. I tried multiple values with no luck. I even tried a loop to go through all values from 0-255.
I have the battery wired to a 7805. Output from the 7805 powers the SN7544... chip and the nodemcu (using the Vin). The battery + also goes to pin 8 of the motor chip.
Motor is wired to pins 3 and 6 of the chip.
What could be wrong? Could it be the output from the nodemcu is not enough to drive the SN7544 chip?

What kind is the "battory" You use?
Post a drawing. It's difficult to understand Your text, pins here and there. Also post the code.
Read the first tropics like " How to use this Forum", "How to post...".
I like to help You with Your problem but not to to write the question.

The NOdeMCU is a lovely board but its NOT an "arduino". SO you WIOLL need to modify the code

I use pins D7 and D8 for the motor and D5 for the speed

??

We ABSOLUTELY need a schematic; NOT a fF**ing Fritzing;

How to make a schematic you can post.

And as Railroader says RTFM

johnerrington:
The NOdeMCU is a lovely board but its NOT an "arduino". SO you WIOLL need to modify the code

NodeMCU PWM with Arduino IDE | NodeMCU
??

Thanks. The link above fixed the issue. The example recommends values of 0-255 for speed, but the link says the full value is 1024 and not 255. I was able to get the motor running by going with values above 500.

 analogWrite(speedPin, speed_value_motor1);
/*
 * Arduino code for SN754410 H-bridge
 * motor driver control.
 * copyleft Feb. 2010, Fabian Winkler
 *
 */
int speedPin = D5; // H-bridge enable pin for speed control
int motor1APin = D7; // H-bridge leg 1
int motor2APin = D8; // H-bridge leg 2
int speed_value_motor1; // value for motor speed
void setup() {
 // set digital i/o pins as outputs:
 pinMode(speedPin, OUTPUT);
 pinMode(motor1APin, OUTPUT);
 pinMode(motor2APin, OUTPUT);
 pinMode(ledPin, OUTPUT);
}

//Winkler, DC motor control with the Arduino board, p.2
void loop() {

 // put motor in forward motion
 digitalWrite(motor1APin, LOW); // set leg 1 of the H-bridge low
 digitalWrite(motor2APin, HIGH); // set leg 2 of the H-bridge high

 // just invert the above values for reverse motion,
 // i.e. motor1APin = HIGH and motor2APin = LOW

 // control the speed 0- 255
 speed_value_motor1 = 500; // half speed
 analogWrite(speedPin, speed_value_motor1); // output speed as
// PWM value
}