For several reasons I needed to read a serial port yesterday. Here is the code below. Make it a great day! Join me on Facebook Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived 'This event will. Supports virtual serial ports (usb to serial, bluetooth serial); hardware/software flow control. Works with all versions of Borland Delphi and.NET. Windows Std Serial Comm Lib for dBase Serial communication component Visual dBASE library for serial port communications.
Hi, If you have a Bluetooth stack on your computer (included in XP SP2 and also available from various third parties bundled with BT dongles) it will allow you to configure a number of serial ports (in Bluetooth part of control panel). You can see these in the device manager under ports. These ports can be used as any other (physical) serial port from vb. See The connecting side will of course connect using various Bluetooth protocols, but you do not need to care about that in your app.
Its just plain old serial programming.
![Vb.Net Bluetooth Serial Port Vb.Net Bluetooth Serial Port](http://nuke.vbcorner.net/Portals/0/immagini/ProgettiVB6/USB_TEST.png)
Start Visual Basic Express 2010.Open a new window with a blank form. Add two Group box from Containers Toolbox menu. Change text of this two box to Connection Settings and Serial monitor. Then add a label, combo box and a button to the 1st group box and change the text and name as follow- label: text to 'COMM PORT' combo box: name to 'lstPorts' button: name to 'Button1' In 2nd Group box add a list box and change the name to 'lstConsole' and a button and change the name to 'Button2' and text to 'Exit'. For Modification and design Purpose you can now change the Form1 Title text to your choice name as I change it to 'Arduino Bluetooth Communication'. Now you have done. Save the projects with any name of your choice.
Then from Debug menu click Build. When successfully done you got your own 'Arduino Bluetooth Communication Software'.
N.B: I assign some key to the buttons as follow- Forward- 'w' Backward-'s' Left-'a' Right-'d' Stop-'c' means when you click the any button it execute the assigned key to arduino so you need to program your own arduino sketch with this key to control. You can also change the baud rate,parity,data bit etc when initialize the code for Button1 The source code is here for reference: Attachments.
When I test with button 1 I get 'access denied'. When I add the Bluetooth dongle I get 2 new com ports on the laptop. Com7, com8 Both labelled 'incoming' When I pair with the Bluetooth device Another comport is added. Com9, labelled 'outgoing' When I test with button 1 I get 'access denied', for any of the 3 ports.
I got the same result with other software in the form of 'exception, access.' , which works on direct serial port via USB converter. I can communicate with the Bluetooth device connected to an ATMEGA168PA from my android phone perfect, both ways. What is wrong? The dongle is a RNBT-C06F from Cambridge Silicon Radio, BLuetooth 4.0 The Bluetooth on the Atmega is RN42-I/RM All help appreciated!