you say on PC but you mean the terminal emulator? when you enter a key on the keyboard of your PC, how will it end up at the micro?
you use some serial connection ?
in that case this would work :
dim x as byte, s as string * 3
do
x=waitkey()
s=s + chr(x)
if len(s)=3 then
x=val(s) 'now the value is stored in byte value into x
print "got " ; x
s="" ' reset for next time
end if
loop
↧