this is the new whole program on the receiving end. If the inpu is not good, then I guess why continue making a big program making leds flash on different Pot output when the Pic cannot identify one input in the first place.
define osc 20
Include "modedefs.bas"
Define LOADER_USED 1
DEFINE LCD_DREG PORTB ' Set LCD Data port
DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 0 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
CMCON=7 ' Disable comparators
'ANSEL=0 ' Set port as digital I/O
ADCON1=7
TrisB = %11111111 'sets all port a as input
TrisA = %00000000 ' sets all port b as output
X VAR BYTE 'VARIABLE TO incoming VALUE
pause 100
mainloop:
X =0
serin2 PORTB.3,n2400,[X]
Lcdout $fe, 1, "Value in: ", dec X
'porta.2 = 1 ' trying to see if the loop is looping
'pause 200
'porta.3 = 1
'pause 200
Goto mainloop
End
as far as the configuration goes, It is an F88, with portB.3 as the input and porta.2 and porta.3 as led output
Bookmarks