Re: control 2 stepper motor with parallel port
i control stepper motor by using visual basic. this is my codes.
Private Sub Command1_Click()
countit = 18 * 12.9 / 90 --the angle is 18 degree and i want to rotation of 360 degree. the purpose is each time that stepping motor rotate 18 degree and stand before countinue run to get 20 times
fre = 20
Do While fre > 0
Do While countit > 0
Out 888, 160
Sleep (100)
Out 888, 32
Sleep (100)
Out 888, 96
Sleep (100)
Out 888, 64
Sleep (100)
Out 888, 80
Sleep (100)
Out 888, 16
Sleep (100)
Out 888, 144
Sleep (100)
Out 888, 128
Sleep (100)
countit = countit - 1
Loop
Out 888, 0
Sleep (10000)
fre = fre - 1
Loop
End Sub
this code use to control stepping motor that has 1.8 angle/step
i use lpt to connect stepper motor and computer (pc)
when i run this code, the stepper motor run and get 18 degree and standing. someones can help me to make this code corectly