Shop OBEX P1 Docs P2 Docs Learn Events
Experiment 26 (Stamp Works) — Parallax Forums

Experiment 26 (Stamp Works)

ArchiverArchiver Posts: 46,084
edited 2001-11-05 00:59 in General Discussion
I am working on stamp works experiment #26. I think I have
everything hooked up correctly and typed in the code. But when I run
the stepper vibrates but doesn't turn. It's like the coils are being
activated, but not in the correct sequence. Any help you can give is
greatly appreciated.

Bill

potcw con 0
potccw con 1
coils var outb

speed var word
x var byte
saddr var byte
rcrt var word
rclf var word
diff var word

step1 data %1100
step2 data %0110
step3 data %0011
step4 data %1001

initialize:

dirb = %1111
speed = 5

main:

for x = 1 to 100
gosub stepfwd
next
pause 200

for x = 1 to 100
gosub steprev
next
pause 200

stepdemo:
high potcw
high potccw
pause 1
rctime potcw,1,rcrt
rctime potccw,1,rclf

rcrt = rcrt max 600
rclf = rclf max 600

diff = abs(rcrt - rclf)
if (diff<25) then stepdemo

if (rclf>rcrt) then stepccw

stepcw:

speed = 60 - (rcrt / 10)
gosub stepfwd
goto stepdemo

stepccw:
speed = 60 - (rclf / 10)
gosub steprev
goto stepdemo

stepfwd:
saddr = saddr + 1 // 4
read (step1 + saddr),coils
pause speed
return

steprev:
saddr = saddr + 3 // 4
read (step1 + saddr),coils
pause speed
return

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-11-05 00:59
    Double check your connections, Bill, and if necessary, download the code from
    the Parallax site -- I promise that it does work.

    -- Jon Williams
    -- Parallax
    -- Author of StampWorks


    In a message dated 11/4/01 4:16:23 PM Central Standard Time, DaMoos@a...
    writes:


    > I am working on stamp works experiment #26. I think I have
    > everything hooked up correctly and typed in the code. But when I run
    > the stepper vibrates but doesn't turn. It's like the coils are being
    > activated, but not in the correct sequence. Any help you can give is
    > greatly appreciated.
    >
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.