roboforum.ruТехнический форум по робототехнике. |
|
|
=DeaD= писал(а):Не понял
fs 1
GOTCHA! You have entered string:AVR-DOS: Ready f0>m0>AVR-DOS: Ready f0>m0>AVR-DO
S: Ready f0>m0>AVR-DOS: Ready f0
Begin to extract tokens
lpos2, token1:9
token1(pos,len):1,8
lpos2, token2:0
token2(pos,len):10,71
Tokens are extracted
Begin to extract next token as string
Res string:AVR-DOS:
First command token is:AVR-DOS:
Command 'AVR-DOS: Ready f0>m0>AVR-DOS: Ready f0>m0>AVR-DOS: Ready f0>m0>AVR-DOS:
Ready f0' not recognized
0000>
GOTCHA! You have entered string:
Begin to extract tokens
Tokens are extracted
0000>GOTCHA! You have e00>GOTCHA! You have e00>GOTCHA! You have e00>GOTCHA! You
have
Do
Gbinp = Waitkey() ' get user input
If Gbinp <> 0 Then ' something typed in?
If Gbinp = 27 Then ' use ESC for exit from interpreter
Exit Do
End If
Waitms 500
Print "get symbol:" ; Gbinp
Waitms 500
Getinput Gbinp ' give input to interpreter
End If
Loop
Sub Getinput(pbbyte As Byte)
' stores bytes from user and wait for CR (&H13)
Select Case Pbbyte
Case &H0A ' do nothing
Case &H0D ' Line-end?
Print Chr(&H0d) ; Chr(&H0a) ;
Print "GOTCHA! You have entered string:" ; Gspcinput
Docommand ' analyse command and execute
Gbpcinputpointer = 1 ' reset for new user-input
Gspcinput = ""
Printprompt
Case &H08 ' backspace ?
If Gbpcinputpointer > 1 Then
Print Chr(&H08);
Decr Gbpcinputpointer
End If
Case Else ' store user-input
If Gbpcinputpointer <= Cpcinput_len Then
Mid(gspcinput , Gbpcinputpointer , 1) = Pbbyte
Incr Gbpcinputpointer
Mid(gspcinput , Gbpcinputpointer , 1) = &H00 ' string-terminator
Print Chr(pbbyte); ' echo back to user
End If
End Select
End Sub
EdGull писал(а):GOTCHA! You have entered string:AVR-DOS: Ready f0>m0>AVR-DOS: Ready f0>m0>AVR-DOS: Ready f0>m0>AVR-DOS: Ready f0
get symbol:99
cget symbol:111
oget symbol:109
mget symbol:109
mget symbol:97
aget symbol:110
nget symbol:100
dget symbol:115
sget symbol:13
GOTCHA! You have entered string:AVR-DOS: Ready for commands
Command 'AVR-DOS: Ready for commands' not recognized
0000>get symbol:10
get symbol:13
GOTCHA! You have entered string:
0000>get symbol:10
get symbol:48
0get symbol:48
0get symbol:48
0get symbol:48
.AVR-DOS: Ready for commands
get symbol:99
cget symbol:111
oget symbol:109
mget symbol:109
mget symbol:97
aget symbol:110
nget symbol:100
dget symbol:115
sget symbol:13
get symbol:10
get symbol:48
0get symbol:48
0get symbol:48
0get symbol:48
Вернуться в МиниБот — национальный класс роботов
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 9