Quote Originally Posted by lerameur
HI

I was not refering to the hardware encoder and decoder.
The program I have below works, but always gives me zero on the lcd.
k
By the way , the command gosub trainreceiver :... gives an eror while compiling , wrong Label..


X VAR BYTE 'VARIABLE TO incoming VALUE
pause 100
mainloop:
X =0
serin PORTB.3,n2400,[X]
Lcdout $fe, 1, "Value in: ", dec X
pause 100
Goto mainloop
End



Now, what are you trying to do here....Make LEDs light up on command or make an LCD work.

If you can't make LEDs do what you want them to, when you want them to do it, how do you expect to make an LCD work correctly?

When you get a good hack on your priorities, let me know, I'm not going anywhere.

Until then, start with the basics and work your way up...

And as far as your program not working, you've got a 100ms pause between checking the serin. Get rid of the pause and use the timeout. If you get a timeout, no data has been received. If you don't get a timeout, you probably got some data. A 100ms is too long of a time to be missing characters. The receiver doesn't store them for you until you're ready to take them.

(On another note, the trainreceiver gosub, try putting that above the main program, but below the setup, it should work correctly then, unless I had a typo or something)

JDG