EmbeddedRelated.com
Forums
Memfault Beyond the Launch

A4988 module+ stepping motor [1 Attachment]

Started by "kar...@yahoo.com [rabbit-semi]" July 24, 2017
Hi, the following is the A4988 module + stepping motor c code for RCM3000,
But stepping motor will only shake without turning, is the program or hardware wiring problems ? thanks.

#use "hobbyist.lib"

#define START_SW HB_PF5
#define MOTOR_STEP HB_PF6
#define MOTOR_DIR HB_PF7
int x;

if(!HBpinRead(START_SW)){
sprintf (status_html, "Start\r");
HBpinHigh(MOTOR_DIR);
for(x = 0; x < 200; x++) {
HBpinHigh(MOTOR_STEP);
waitfor(DelayMs(500));
HBpinLow(MOTOR_STEP);
waitfor(DelayMs(500));
}

waitfor(DelayMs(1000));

Memfault Beyond the Launch