Hi,
Your example data:
21 AD 34 01 22 EF 23 02
===============================================
' The code (Not tested)
my_array VAR BYTE[7] ' Define array variable with 7 locations
SERIN2 IN_PIN, BAUD,[WAIT("!") STR my_array\7]
' Waits for the string "!", then collects the next 7 characters.
' (21 HEX = ASCII !)
===============================================
This could be valid data:
21 21 21 01 22 21 21 02
Make sure you verify that "01" "22" "02" are in the
right position in the array.
* * * * * *
From PicBasic manual:
An optional Timeout and Label may be included to allow the program
to continue if a character is not received within a certain amount of time.
Timeout is specified in 1 millisecond units. If the serial input pin stays in
the idle state during the Timeout time, the program will exit the SERIN2
command and jump to Label.
* * * * * *
PicBasic Pro Code that demonstrates the use of modifiers
with the Serin2 and Serout2 commands.
http://www.microengineeringlabs.com/...bp/ser2mod.bas
Luciano
Bookmarks