
Load "Theremino_HAL\Theremino_SignalScope.exe"
Load "Theremino_HAL\Theremino_HAL.exe"

Button 15 Text AbortSewing

Variable Numeric SlotX = 1
Variable Numeric SlotY = 3
Variable Numeric SlotZ = 5
Variable Numeric StopAngle = 90
Variable Numeric StartAngle = 270

Variable Numeric Xmax = 900
Variable Numeric Xmin = 0
Variable Numeric Ymax = 900
Variable Numeric Ymin = 0
Variable Numeric MaxPitch = 4
Variable Numeric MaxPerSec = 15

SewInit SlotX SlotY SlotZ StopAngle StartAngle

SewLimits Xmin Xmax Ymin Ymax MaxPerSec



SewTo 2 2 500 0 ""
Gosub WaitSewProgress

v1 = ElapsedTime

SewTo 102 2 10 4 ""   '50
'SewTo 102 2 20 3 "Radius=15.92"
Gosub WaitSewProgress

v2 = ElapsedTime

Print Format(v2 - v1, "0.000") + " sec."

Stop


Label AbortSewing
	SewAbort
Return

Label WaitSewProgress
	Variable Numeric wsp1
	For wsp1 = 1 To Infinity
		If SewProgress < 0
			wsp1 = SewProgress
			Exit
		EndIf
		Print Int(Abs(SewProgress) * 100) + "%"
		' Print Mod(Slot(Slot_MotorZ),1)
	Next
Return


'WATCH SewTo_Speed
'EXEC Button 5 Text Button5
