I found this on a nest box website regarding the number of visits or rather the amount of food the parents bring to the young:
Each chick can eat 100 caterpillars a day, so adults need to find as many as 1000 caterpillars a day for a brood of 10!
So with this in mind a WORD would be needed as a counter, so I've modified the code to send a WORD instead of a BYTE and added a test number (600):
Code:
TEST VAR word
LET Test = 600
SEROUT2 D_OUT,BAUD,[PreAmble,Synch,DAT_OUT,DAT_OUT,CHK_SUM,TEST.HIGHBYTE,TEST.LOWBYTE]
And for the receiver:
Code:
TEST var word
X VAR BYTE
SERIN2 D_IN,N2400,[WAIT(Synch),DAT_IN1,DAT_IN2,CHK_SUM,TEST.HIGHBYTE,TEST.LOWBYTE]
IF TEST = 600 THEN LED
GOTO MAIN
lED:
for X = 1 to TEST 'Test = 600
HIGH PORTA.1
PAUSE 500
LOW PORTA.1
pause 500
next X
GOTO MAIN
END
And it works, the led flashes 600 times (I know I've counted them)
Another small step nearer.
Dave
Bookmarks