Programming for 2-wire connection of Unipolar Stepper Motor
►C Programming
►Assembly Programming
The working of the above code can be seen in the demo animation below.
►C Programming
CODE:
void main(){
while(1){
stepper = 0x03;
delay();
stepper = 0x01;
delay();
stepper = 0x00;
delay();
stepper = 0x02;
delay();
}
}
while(1){
stepper = 0x03;
delay();
stepper = 0x01;
delay();
stepper = 0x00;
delay();
stepper = 0x02;
delay();
}
}
►Assembly Programming
CODE:
main:
mov stepper, #03H
acall delay
mov stepper, #01H
acall delay
mov stepper, #00H
acall delay
mov stepper, #02H
acall delay
sjmp main
mov stepper, #03H
acall delay
mov stepper, #01H
acall delay
mov stepper, #00H
acall delay
mov stepper, #02H
acall delay
sjmp main
The working of the above code can be seen in the demo animation below.
No comments:
Post a Comment