This project has moved and is read-only. For the latest updates, please go here.

Some use VB.Net?

Dec 11, 2014 at 11:48 AM
Hi. Someone use for control brick VB.net? Can you show some starting example? Just communication part.
Mar 10, 2015 at 10:30 PM
I am using VB.NET to write my EV3 apps, and have been able to connect using the following statements:
Me.MyBrick = New Brick(New BluetoothCommunication())
AddHandler Me.MyBrick.BrickChanged, AddressOf Me.MyBrick_BrickChanged
Await Me.MyBrick.ConnectAsync()
I can't claim to have any good examples, but you should be able to translate most of the stuff you see in the C# examples without much trouble, since they use the same classes. For any specific problems, you would need to give more detail on what you need. But it's definitely good to know that I'm not the only person using VB.NET!
Mar 10, 2015 at 10:36 PM
Hi. Thx for answer. I try use this example in next time (now i not have environment for test).
I really cant find worked example for connect brick on BT.

I have 1 problem. I good coding on VB6 and i bad understand NET environment. Thx for answer.
Mar 10, 2015 at 10:36 PM
njsokalski wrote:
I am using VB.NET to write my EV3 apps, and have been able to connect using the following statements:
Me.MyBrick = New Brick(New BluetoothCommunication())
AddHandler Me.MyBrick.BrickChanged, AddressOf Me.MyBrick_BrickChanged
Await Me.MyBrick.ConnectAsync()
I can't claim to have any good examples, but you should be able to translate most of the stuff you see in the C# examples without much trouble, since they use the same classes. For any specific problems, you would need to give more detail on what you need. But it's definitely good to know that I'm not the only person using VB.NET!
Hi. Thx for answer. I try use this example in next time (now i not have environment for test).
I really cant find worked example for connect brick on BT.

I have 1 problem. I good coding on VB6 and i bad understand NET environment. Thx for answer.
Apr 16, 2015 at 6:54 PM
Edited Apr 23, 2015 at 8:57 AM
Well... for other ppl... Full part for VB.NET connect on BT (port4)
Imports Lego.Ev3.Core
Imports Lego.Ev3.Desktop
Public Class Form1
    Dim Brick As New Brick(New BluetoothCommunication("COM4"))

    Private Async Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        AddHandler Brick.BrickChanged, AddressOf MyBrick_BrickChanged
        Await Brick.ConnectAsync()
        Await Brick.DirectCommand.PlayToneAsync(100, 100, 100)
    End Sub

    Private Sub MyBrick_BrickChanged(sender As Object, e As BrickChangedEventArgs)
        Debug.WriteLine("Status changed")
    End Sub

End Class