-
display received data
hi,
i'm currently working on a project dealing with PIC16f886,xbee and also LCD. the problem is, i need to display my data received from a sensor node in lcd. here i provide u with the TX and RX code.
TX code:
Code:
@ device hs_osc
define OSC 20
dta var word
dta=83
main:
High PORTB.0
pause 50
serout2 PORTB.1, 84, ["A",dta]
low portB.0
Pause 50
goto main
end
RX code:
Code:
@ device hs_osc
define osc 20
dta var word
main:
high portb.0
pause 50
serin2 portc.7,84,[wait("A"),dta]
pause 50
serout2 portc.6,16468,[dta]
low portb.0
pause 50
goto main
from the above code, how can i display the characterS to LCD?
tq
-
That's because the ASCII code for "S" is 83 which is what you're sending. To display "83", on the receiving end, do:
Code:
serout2 portc.6,16468,[DEC dta]
-
tq for the sugesstion. one more question, how can i display '83' in LCD? is this code below relevant?
Code:
@ device hs_osc
define osc 20
define LCD_EBIT 1
DEFINE LCD_RSBIT 0
DEFINE LCD_DBIT 4
DEFINE LCD_DREG PORTC
DEFINE LCD_RSREG PORTC
DEFINE LCD_EREG PORTC
dta var word
main:
high portb.0
pause 50
serin2 portc.7,84,[wait("A"),dta]
pause 50
serout2 portc.6,16468,[dta]
LCDOUT $FE,1
lcdout #dta
low portb.0
pause 50
goto main
-
Hi,
I'm sorry, I thought you where using a serial LCD and SEROUT2 to write to that display since there was no LCDOUT in the code in your first post.
Code:
dat VAR BYTE
dat = 83
LCDOUT $FE, 1, "dat = ", #dat
Have a look at the manual for the various modifiers that can be used.