Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Problem of communication between visual basic 6.0 and PIC16F877A by using RN41

Status
Not open for further replies.

reeve333

New Member
Hi.....

I am doing a project that need to sent and received signal from Computer to PIC and i using RN41 to be my wireless connection.Unfrotunely, i meet a problem, when i success to connect the RN41 with my computer (which mean turn the red LED to Green LED) I unable to sent any data out.

The following is my VB doing


Visual Basic Coding
___________________________________________________________________________

Private Sub Command2_Click()
MSComm1.Output = "a"
End Sub



Private Sub Command3_Click()
If Combo1.Text = "" Then
MsgBox "Please select the Port to open"
Else
If Command3.Caption = "Open" Then
MSComm1.CommPort = Combo1.Text
MSComm1.PortOpen = True
Command3.Caption = "Close"
Frame3.Enabled = True
Else
MSComm1.PortOpen = False
Command3.Caption = "Open"
Frame3.Enabled = False
End If
End If
End Sub



Private Sub MSComm1_OnComm()

Dim data As String
If MSComm1.CommEvent = comEvReceive Then
data = MSComm1.Input

If data = "X" Then
Text1.Text = ""
ElseIf data = "Z"

Else
Text1.Text = Text1.Text & data
End If

MSComm1.RThreshold = 0
MSComm1.InputLen = 0
End If
MSComm1.RThreshold = 1
MSComm1.InputLen = 1

End Sub
__________________________________________________________________________


May i know is it my coding got any problem so i not able to sent data out??

Anyone any idea please tell me......
Thanks for advance.

For additional, anyone can contact me with my personal email as well.
reeve333@yahoo.com
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top