Entering a value in debug terminal without pressing enter.
Hi all, what is the best way or a way to monitor a value imputed into the debug terminal without pressing enter?
DEBUGIN DEC Name_Value
IF Name_Value = 8 THEN....
...ENDIF
I don't want to press enter after the value 8 is pressed.
DEBUGIN DEC Name_Value
IF Name_Value = 8 THEN....
...ENDIF
I don't want to press enter after the value 8 is pressed.
Comments
In the mean time what is DEC short for? I have been thinking it was the deceleration for any number 0 to 9.
Also you can use simply
[SIZE=1][FONT=courier new]DEBUGIN Name_Value IF Name_Value = "8" THEN....[/FONT][/SIZE]
Note that there is in this snippet no DEC before Name_Value, and the 8 is in quotes. The response input could be any character, not just numeric, for example "A", or "$". No ENTER required.Now to figure out why I am freezing up. I pressed 8, held it, all was well, and whamo I got this (see picture).
IF human_step_control = "8" THEN GOSUB step_fwd IF human_step_control = "2" THEN GOSUB step_rev endif endif
versus
IF human_step_control = "8" THEN GOSUB step_fwd endif IF human_step_control = "2" THEN GOSUB step_rev end if
? ? ?
' {$STAMP BS2p} ' {$PBASIC 2.5} ' {$PORT COM4} Phase VAR OUTB 'phase control outputs StpsPerRev CON 48 'whole steps per rev idx VAR Byte 'loop counter stpIdx VAR Nib 'step pointer stpDelay VAR Byte 'delay for speed control Human_Step_Control VAR Word Steps DATA %0011, %0110, %1100, %1001 Setup: DIRB = %1111 stpDelay = 15 Main: FOR idx = 1 TO StpsPerRev GOSUB Step_Fwd NEXT PAUSE 20 FOR idx = 1 TO StpsPerREv GOSUB Step_Rev NEXT PAUSE 500 GOTO Test Step_Fwd: stpIdx = stpIdx + 1 // 4 GOTO Do_Step Step_Rev: stpIdx = stpIdx + 3 // 4 GOTO Do_Step Do_Step: READ (Steps + stpIdx), Phase PAUSE stpDelay RETURN Test: DEBUG CLS, "Control Stepper:", CR DO DEBUGIN Human_Step_Control IF Human_Step_Control = "8" THEN GOSUB Step_Fwd PAUSE 50 DEBUG CLS ENDIF IF Human_Step_Control = "2" THEN GOSUB Step_Rev PAUSE 50 DEBUG CLS ENDIF LOOP
if human_step_control = "8" then gosub step_fwd elseif human_step_control = "2" then gosub step_rev endif
orselect human_step_control case "2" gosub step_rev case "8" gosub step_fwd endselect