I purchased a really cool motor shield for my node mcu v2
ESP8266: NodeMCU Motor Shield Review – Squix – TechBlog
After hooking it up to a simple dc motor on motor a ports it didn't work. so I hooked up my meter to the motor b + & - ports and still get 0 volts. I am powering nodemcu from computer USB.
So my 2 questions are
If it's hooked up correctly there should be a voltage read, correct?
Do you have any suggestions on getting this to work?
/*
Board pin | NodeMCU GPIO | Arduino IDE
A- 1 5 or D1
A+ 3 0 or D3
B- 2 4 or D2
B+ 4 2 or D4
*/
const int pwmMotorA = D1;
const int pwmMotorB = D2;
const int dirMotorA = D3;
const int dirMotorB = D4;
int motorSpeed = 500;
void setup() {
Serial.begin(115200);
Serial.println();
pinMode(pwmMotorA , OUTPUT);
pinMode(pwmMotorB, OUTPUT);
pinMode(dirMotorA, OUTPUT);
pinMode(dirMotorB, OUTPUT);
Serial.println("Motor SHield 12E Initialized");
delay(5000);
}
void loop() {
Serial.println("Activate A");
digitalWrite(pwmMotorA, motorSpeed);
digitalWrite(dirMotorA, LOW);
delay(1500);
Serial.println("Reverse A");
digitalWrite(dirMotorA, HIGH);
delay(1500);
Serial.println("Stop A");
digitalWrite(pwmMotorA, 0);
digitalWrite(dirMotorA, LOW);
delay(3000);
Serial.println("Activate B");
digitalWrite(pwmMotorB, motorSpeed);
digitalWrite(dirMotorB, LOW);
delay(1500);
Serial.println("Reverse B");
digitalWrite(dirMotorB, HIGH);
delay(1500);
Serial.println("Stop B");
digitalWrite(pwmMotorB, 0);
digitalWrite(dirMotorB, LOW);
delay(3000);
}