just tried that raw test [no code], it works great, no stutter, all of the motors spin perfectly this tells me there's a glitch with Applesoft Basic so I still have to dissect the code some more to see where it gets corrupted
these are the hard-coded values from the raw test,
POKE 49344, 0 ---> ALL Ports=OFF POKE 49344, 1 ---> Port# 0=ON POKE 49344, 2 ---> Port# 1=ON POKE 49344, 4 ---> Port# 2=ON POKE 49344, 8 ---> Port# 3=ON POKE 49344, 16 ---> Port# 4=ON POKE 49344, 32 ---> Port# 5=ON
Then, we tried using this combination, so we can run the motors fwd and rev this requires using the combined Ports, A, B, C to use the Motor Bridge circuit POKE 49344, 1 ---> Port# A=FWD [Right Motor] POKE 49344, 4 ---> Port# B=FWD [Left Motor] POKE 49344, 16 ---> Port# C=FWD
POKE 49344, 2 ---> Port# A=REV POKE 49344, 8 ---> Port# B=REV POKE 49344, 32 ---> Port# C=REV
we used this convention for the motor direction Fwd: Binary= 01 Rev: Binary= 10
Then, we tried using this combination, so we can run 2 motors at the same time the robot only has 2 motors for now so just these permutations are used here POKE 49344, 5 ---> Binary= 0101, Port# A+B=FWD POKE 49344, 10 ---> Binary= 1010, Port# A+B=REV
POKE 49344, 4 ---> Binary= 0100, Port# A+B Turn Right Fwd POKE 49344, 1 ---> Binary= 0001, Port# A+B Turn Left Fwd
POKE 49344, 8 ---> Binary= 1000, Port# A+B Turn Right Rev POKE 49344, 2 ---> Binary= 0010, Port# A+B Turn Left Rev
POKE 49344, 6 ---> Binary= 0110, Port# A+B Spin Right Fwd [Left=Fwd, Right=Rev] POKE 49344, 9 ---> Binary= 1001, Port# A+B Spin Left Fwd [Left=Rev, Right=Fwd]
Kudos to Dan for his patience as I worked through all the decimal-binary conversions by hand. Obviously the actual math is first-grade level, but what you guys all memorized (conversion-wise and binary addition-wise), I have to stop and deduce each time. It works perfectly. To make the programming easier I'm setting a variable (probably "M" for "move") rather than typing the POKE address each time. We also figured out a good way to use all of the Apple joystick's functions. For example, while turning the stick left, I'll users press button 0 for a standard left turn (left tread off, right tread forward) or button 1 for a left spin (left tread reverse, right tread forward). Wanna spin left? POKE M,9 ... etc. ... beautiful.