looking at the code :
// functional connections
#define MOTOR_B_PWM HG7881_B_IA // Motor B PWM Speed
#define MOTOR_B_DIR HG7881_B_IB // Motor B Direction
So for this test, just trying to run it clockwise you don’t need to use IB as for IA as you can see in the code, case 1 of the switch :
case
'1'
:
// 1) Fast forward
digitalWrite( MOTOR_B_DIR, LOW );
digitalWrite( MOTOR_B_PWM, LOW );
delay( DIR_DELAY );
// set the motor speed and direction
digitalWrite( MOTOR_B_DIR, HIGH );
// direction = forward
analogWrite( MOTOR_B_PWM, 255-PWM_FAST );
// PWM speed = fast
isValidInput =
true
;
break
;
the IA is drived using analogWrite( MOTOR_B_PWM, 255-PWM_FAST ); so they are using pwm.
I know there is the table at the beginning of the tuto but they don’t explecitly sayed that you could drive it with a solid HIGH on IA or at least I don’t see it.
Yes yes it works with RPI but you can make an easy test : just wire a 5v or so power supply to the IA and see if it works, it may but anyways it’s not good as it will try to run your motors at max speed not necessarily letting the motor the time to move resulting in undefined behavior; then just briefly touch the IA with 5v wire and your motor will do a step if you are fast enought.
Anyway you need to do a proper pwm code as you will need it soon enough to controle speed.
No driver is made to be controlled with const voltave on a pwm pin it’s just not made for that and most of them won’t work like that at all moreover the lack of documentation make it impossible to predict the speed of the motor if pwm stay high resulting in hardly approximatable motor position estimation…
Just try IA pin with 10Hz pwm with 50% duty cycle if it don’t work try with 100Hz and then with and without common GND.
If it still don’t work I would say : Houston, We’ve Got a Problem !
Best of luck !