Hello,
i want to send commands about a Visual Basic (Express 2008) about IR to a pic.
The IR Led is connected with my pc on COM 1.
My VB Code Snippet:
Code:
[...]
' Connection to COM1
With serialPort
.PortName = cbbCOMPorts.Text 'COM1
.BaudRate = 2400
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
End With
[...]
serialPort.Write(txtDataToSend.Text) 'txtDataToSend = Input txt field
My PBP Code for recipient
Code:
main:
serin ir,0,["9999"],dat
IF dat=1 THEN
led2=turnoff
led1=turnon
ENDIF
IF dat=5 THEN
led1=turnoff
led2=turnon
ENDIF
GOTO main
My PBP Code for sender
Code:
main:
SEROUT led5,12,["9999",1]
PAUSE 100
SEROUT led5,12,["9999",5]
PAUSE 100
GOTO main
With this PBP Code it works regarding Pic to Pic communication.
But if I send "99991" or "99995" by my Visual Basic programm it does not work.
I read in the manual that the 12 in the SEROUT command send the data "open inverted" - what does it mean? How could I "open inverted" my command in Visual Basic (Express 2008)?
Best regards
EDIT: Additional Information I use a PIC 12F629
Bookmarks