REM Attempt to move motor a variable speed PRINT "JogTest1.bas: Moves motor continously at variable speed, speed entered at terminal." PRINT "To stop the program enter a speed of zero at the prompt." REM Set motor currents INPUT "Enter motor current in mA (200 - 600): "; current WHILE current > 600 OR current < 200 INPUT "I said 200-600. Try again: "; current WEND CURRENTRUN = current / 1.2 CURRENTBOOST = current CURRENTIDLE = current * 0.5 BOOST = AUTO REM Set maximum rpm maxrpm = 1000 REM Set the UNITS UNITS = 51200 :REM Set units so that 1 = 1 revolution REM Main loop of program ENERGISE = ON WHILE NOT KEY :REM Does loop unless key is held down INPUT "Enter new speed in rpm (max 1000): "; rpm WHILE rpm > 1000 INPUT "That's higher than the maximum. Try again: "; rpm WEND IF rpm = 0 THEN EXIT newspeed = rpm / 60.0 JOG = newspeed WEND STOP ENERGISE = OFF PRINT "Program ended by zero entered speed or key." END REM called if the program aborts DEFHALT STOP ENERGISE = OFF ENDHALT