VB6 code :
Private Sub Form_Load()
' Use COM1
MSComm1.CommPort = 1
' 2400 baud, no parity, 8 data bits, 1 stop bit
MSComm1.Settings = "2400,N,8,1"
' Disable DTR
MSComm1.DTREnable = False
' Open the port
MSComm1.PortOpen = True
InputLen = 0
RThreshold = 0
End Sub
MSComm1.Output = Chr$(255)
End Sub
-----------
Is the mscomm1.output being called by something? From this, it looks like it never gets there. Do you have a button to click to send it? Try adding a command button and:
sub command1_click() 'turn LED on for 5 seconds
mscomm1.output=chr$(255) & chr$(1) 'sends (255)(1)
Try this:
led var byte
grabserial:
serin porta.4,4,[255],led
if led=1 then 'turn on the led
high portb.4
pause 5000 'wait 5 seconds
low portb.4
endif
goto grabserial
end
---------Picster---------




Bookmarks