***program start*** 100 '-------- StepperMotor ------------ 110 ' 4 phase unipolar 120 ' 2-2 excitation 125 ' Right and left are set based on the direction of travel 130 ' Left: 0:io0 - x 140 ' 1:io1 - ~x 150 ' 2:io2 - y 160 ' 3:io3 - ~y 170 ' Right:4:io4 - x 180 ' 5:io5 - ~x 190 ' 6:io6 - y 195 ' 7:io7 - ~y 200 ' 210 dim PatternL[4],PatternR[4] 220 PatternL[0]=10:PatternL[1]=11:PatternL[2]=1:PatternL[3]=0 225 PatternR[0]=0:PatternR[1]=1:PatternR[2]=11:PatternR[3]=10 230 for i=0 to 200 240 ss=i-i/4*4 245 pat=PatternL[ss] 250 if pat>=10 then out 0,1:out 1,0:pat=pat-10 else out 0,0:out 1,1 255 if pat>=1 then out 2,1:out 3,0 else out 2,0:out 3,1 260 pat=PatternR[ss] 265 if pat>=10 then out 4,1:out 5,0:pat=pat-10 else out 4,0:out 5,1 275 if pat>=1 then out 6,1:out 7,0 else out 6,0:out 7,1 280 'sleep 20 290 'if i-i/2*2=0 then out 16,1 else out 16,0 300 next 310 out 0,0:out 1,0:out 2,0:out 3,0 400 end ***program end***