
www.veear.eu
User Manual (1.0.11)
EasyVR 3
35
Recognition of a built-in or custom SI command
# start recognition in wordset 1
SEND 'i'
SEND 'B'
# wait for reply:
# (if 5s timeout has been set, wait for max 6s then abort
# otherwise trigger recognition could never end)
result = RECEIVE
IF result = 's' THEN
# successful recognition, ack and read result
SEND ' '
command = RECEIVE – 'A'
# perform actions according to command
ELSE IF result = 't' THEN
# timed out, no word spoken
ELSE IF result = 'e' THEN
# error code, ack and read which one
SEND ' '
error = (RECEIVE – 'A') * 16
SEND ' '
error = error + (RECEIVE – 'A')
# perform actions according to error
ELSE
# invalid request or reply
ERROR
END IF
Adding a new SD command
# insert command 0 in group 3
SEND 'g'
SEND 'D'
SEND 'A'
IF RECEIVE = 'o' THEN OK ELSE ERROR
# set command label to “ARDUINO_2009”
SEND 'g'
SEND 'D'
SEND 'A'
SEND 'Q'
# name length (16 characters, digits count twice)
SEND 'A'
SEND 'R'
SEND 'D'
SEND 'U'
SEND 'I'
SEND 'N'
SEND 'O'
SEND '_'
# encode each digit with a ^ prefix
# followed by the digit mapped to upper case letters
SEND '^'
SEND 'C'
SEND '^'
SEND 'A'
SEND '^'
SEND 'A'
SEND '^'
SEND 'J'
IF RECEIVE = 'o' THEN OK ELSE ERROR