Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 650 of 909
EXAMPLE:
OFF
KP=100 'Set Proportional Gain
O=1234 'Set origin to 1234
a=1
b=2
PRINT8("Demonstration:",#13)
PRINT8("a=",a)
PRINT8(" and b=",b,#13)
PRINT8("a+b=",a+b,#13)
PRINT8("Position: ",PA,#13)
WAIT=10 'Allow time for serial buffer processing
PRINT8("KP=",KP,#13)
PRINT8("Hello World",#13,#13)
PRINT8("Run Subroutines",#13)
WAIT=10
PRINT8(#128,"GOSUB5 ",#13) 'Tell all motors to run subroutine
C5
WAIT=10
PRINT8(#129,"GOSUB10",#13) 'Tell Motor-1 to run subroutine
C10
WAIT=10
PRINT8(#130,"GOSUB20",#13) 'Tell Motor-2 to run subroutine
C20
WAIT=10
PRINT8(#131,"GOSUB30",#13) 'Tell Motor-3 to run subroutine
C30
x=123
PRINT8(#132,"GOSUB",x,#13) 'Tell Motor-4 to run subroutine
C123
v=100000
a=100
p=2000
PRINT8(#130,"ADT=",a," VT=",v,#13) 'Set speed and accel/decel in motor 2
WAIT=10
PRINT8(#130,"MP PT=",p," G",#13) 'Command Motor-2 to position 2000
WAIT=10
PRINT8(#13,#13,"End of Demonstration.",#13)
END
Part 2: Commands: PRINT8(...)