Try this, Chris. Set the monitor com rate to 19200 since you use Debug
Print. The input pin is pulled high here and I see no serial activity
as a result. If you leave it floating and unconnected to a source
you'll probably see noise. I didn't put a 2400 baud source on it but I
suspect you'll start to see something sane from here.
Tom
Option Explicit
dim com3_out(1 to 30) as byte
dim com3_in(1 to 30) as byte
const IDpin as byte = 13 ' ID in pin
const CMDpin as byte = 14 ' CMD to esc
dim count as integer ' byte count
dim IDs(1 to 7) as byte ' ID numbers as read over serial
Public Sub Main()
debug.print "Beginning..."
call putpin(IDpin, 3) 'pullup pin
dim i as byte
for i=1 to 7 'init data
IDs(i)= 255
next
call openqueue(com3_out, 30)
call openqueue(com3_in, 30)
call definecom3(IDpin, CMDpin, bx0000_1000)
call opencom(3, 2400, com3_in, com3_out)
do
debug.print cstr(getqueuecount(com3_in))
count = getqueuecount(com3_in)
if (count >= 7) then
getqueue com3_in, IDs, 7
end if
debug.print cstr(IDs(1));
for i=2 to 7
debug.print ", "; cstr(IDs(i));
next
debug.print
debug.print
delay 0.5
loop
End Sub