Log in

View Full Version : Problem in Serial Communication



uuq1
- 3rd June 2005, 10:17
I am getting the following error :
expected ']'

The source code is :
'========================================
Include "modedefs.bas"
DEFINE OSC 20 '20MHz

RecByte var byte

Symbol PinIn = PortB.7

Start:
PAUSE 150
TRISA=0 'PORTA PIN All outputs
TRISB=%10000000 'PORTB ALL OUTPUTS
PORTA=0 'CLEAR PORTA
PORTB=0 'CLEAR PORTB

Execute:
Serin2 PinIn,396,[WAIT("X"),SKIP 1, DEC testbyte]
pause 100
high PORTB.1
pause 200
low PORTB.1
GOTO Execute
END

'============================================

I want to transmit X90Z where X is the start charachter and Z is the ending char.

Can anybody guide ?

Ingvar
- 3rd June 2005, 11:37
You haven't declared the variable "testbyte".

uuq1
- 5th June 2005, 07:17
Yes, declaring the variable solved my problem.
Thanks for the help.