PDA

View Full Version : Serin/Out for multiple bytes



mankan
- 5th June 2006, 18:54
Dear All,

I would like to send multiple bytes using serout and receive the same using serin.

Could you please let me know to do that. Any example will be really great.

Thanks,
Mankan

mister_e
- 5th June 2006, 19:58
' ---------------------------------[ Transmitter ]---------------------------------------
Byte1 var byte
Byte2 var byte
Byte3 var byte
Byte4 var byte

Serout Serpin,Baud,[byte1,byte2,byte3,byte4]

' ---------------------------------[ Receiver ]------------------------------------------
Byte1 var byte
Byte2 var byte
Byte3 var byte
Byte4 var byte

Serin serpin,Baud,[byte1,byte2,byte3,byte4]
OR


' ---------------------------------[ Transmitter ]---------------------------------------
MultipleBytes var byte[4]

Multiplebytes[0]=0
Multiplebytes[0]=1
Multiplebytes[0]=2
Multiplebytes[0]=3

Serout2 Serpin,Baud,[str multiplebytes]


' ---------------------------------[ Receiver ]------------------------------------------
MultipleBytes var byte[4]

Serin2 Serpin,Baud,[str multiplebytes\4]