Without code tags:
let PinsB = %10000000 'B.4 Energised B.7?
pause w2
let PinsB = %11000000 'B.4,B.5 Energised B.7,B.6?
pause w2
let PinsB = %01000000 'B.5 Energised B.6?
pause w2
let PinsB = %01100000 'B.5,B.6 Energised
pause w2
let PinsB = %00100000 'B.6 Energised B.5?
pause w2
let PinsB = %00110000 'B.6,B.7 Energised B.4, B.5?
pause w2
let PinsB = %00010000 'B.7 Energised B.4?
pause w2
let PinsB = %10010000 'B.7,B.4 Energised
pause w2
You can get by without the "Pins" command with something like this:
#PICAXE08M2
; Drives a bipolar stepper motor using two PICAXE outputs, an L293D driver chip and a 74HCT004 inverter
; Sequence: Coil 1 Coil 2
; 1 1
; 0 1
; 0 0
; 1 0
b0=10
main:
irin[1000,main],c.3,infra
sertxd(#infra)
if infra=0 then avant
if infra=1 then arriere
if infra>1 then goto main
avant: for b1=1 to 3
high c.4 ; To coil 1
pause b0
high c.1 ; To coil 2
pause b0
low c.4
pause b0
low c.1
pause b0
next b1
goto main
arriere: for b1= 1 to 3
high c.4
pause b0
low c.1
pause b0
low c.4
pause b0
high c.1
pause b0
next b1
goto main
let PinsB = %10000000 'B.4 Energised B.7?
pause w2
let PinsB = %11000000 'B.4,B.5 Energised B.7,B.6?
pause w2
let PinsB = %01000000 'B.5 Energised B.6?
pause w2
let PinsB = %01100000 'B.5,B.6 Energised
pause w2
let PinsB = %00100000 'B.6 Energised B.5?
pause w2
let PinsB = %00110000 'B.6,B.7 Energised B.4, B.5?
pause w2
let PinsB = %00010000 'B.7 Energised B.4?
pause w2
let PinsB = %10010000 'B.7,B.4 Energised
pause w2
You can get by without the "Pins" command with something like this:
#PICAXE08M2
; Drives a bipolar stepper motor using two PICAXE outputs, an L293D driver chip and a 74HCT004 inverter
; Sequence: Coil 1 Coil 2
; 1 1
; 0 1
; 0 0
; 1 0
b0=10
main:
irin[1000,main],c.3,infra
sertxd(#infra)
if infra=0 then avant
if infra=1 then arriere
if infra>1 then goto main
avant: for b1=1 to 3
high c.4 ; To coil 1
pause b0
high c.1 ; To coil 2
pause b0
low c.4
pause b0
low c.1
pause b0
next b1
goto main
arriere: for b1= 1 to 3
high c.4
pause b0
low c.1
pause b0
low c.4
pause b0
high c.1
pause b0
next b1
goto main
Code:
let PinsB = %10000000 'B.4 Energised B.7?
pause w2
let PinsB = %11000000 'B.4,B.5 Energised B.7,B.6?
pause w2
let PinsB = %01000000 'B.5 Energised B.6?
pause w2
let PinsB = %01100000 'B.5,B.6 Energised
pause w2
let PinsB = %00100000 'B.6 Energised B.5?
pause w2
let PinsB = %00110000 'B.6,B.7 Energised B.4, B.5?
pause w2
let PinsB = %00010000 'B.7 Energised B.4?
pause w2
let PinsB = %10010000 'B.7,B.4 Energised
pause w2
You can get by without the "Pins" command with something like this:
#PICAXE08M2
; Drives a bipolar stepper motor using two PICAXE outputs, an L293D driver chip and a 74HCT004 inverter
; Sequence: Coil 1 Coil 2
; 1 1
; 0 1
; 0 0
; 1 0
b0=10
main:
irin[1000,main],c.3,infra
sertxd(#infra)
if infra=0 then avant
if infra=1 then arriere
if infra>1 then goto main
avant: for b1=1 to 3
high c.4 ; To coil 1
pause b0
high c.1 ; To coil 2
pause b0
low c.4
pause b0
low c.1
pause b0
next b1
goto main
arriere: for b1= 1 to 3
high c.4
pause b0
low c.1
pause b0
low c.4
pause b0
high c.1
pause b0
next b1
goto main