SerReceive channel, output

Command Availability:

Available on all microcontrollers.


This command will read a byte from the RS232 channel given by channel according to the rules set using InitSer, and store the received byte in the variable output.


	'This program will read a byte from PORTB.2, and set the LED on if
	'the byte is more than 50. This can be used with the SerSend
	'example program.

	#chip 16F88, 8
	#config Osc = Int

	#define RecAHigh PORTB.2 ON
	#define RecALow PORTB.2 OFF
	#define LED PORTB.0

	Dir PORTB.0 Out
	Dir PORTB.2 In

	InitSer 1, r9600, 1 + WaitForStart, 8, 1, none, normal
		SerReceive 1, Temp
		If Temp <= 50 Then Set LED Off
		If Temp > 50 Then Set LED On

For more help, see RS232 Software Overview, InitSer