Hi, I have just bought a Genuino 101 and I have a problem with serial communication. I have written a simple Arduino code that sends data (a simple string like "1234") over the serial connection. I can visualize the data on the IDE Serial Monitor and on Tera Term. However, I have also written a simple application in Visual Basic that reads from the serial port and it doesn't work. It works very well with Arduino Uno but not with the 101.
The port opens but when I read the serial I get an empty string.
I have also tried with this example Arduino and Visual Basic Part 1: Receiving Data From the Arduino | Martyn Currey and again it works fine with UNO but not with 101. is there any difference in the serial protocol between a traditional arduino and the 101?
Do you know of a serial interface in VB that works with the 101?
tks
nunzio
I got that code to work on my 101 by adding one line in the SerialPort1 initialization. I an using the example sketch CurieTime/ReadTest
SerialPort1.DtrEnable = True
Private Sub connect_BTN_Click(sender As Object, e As EventArgs) Handles connect_BTN.Click
If (connect_BTN.Text = "Connect") Then
If (comPORT <> "") Then
SerialPort1.Close()
SerialPort1.PortName = comPORT
SerialPort1.BaudRate = 9600
SerialPort1.DataBits = 8
SerialPort1.Parity = Parity.None
SerialPort1.StopBits = StopBits.One
SerialPort1.Handshake = Handshake.None
SerialPort1.Encoding = System.Text.Encoding.Default
SerialPort1.ReadTimeout = 10000
SerialPort1.DtrEnable = True
SerialPort1.Open()
connect_BTN.Text = "Dis-connect"
Timer1.Enabled = True
Timer_LBL.Text = "Timer: ON"
Else
MsgBox("Select a COM port first")
End If
Else
SerialPort1.Close()
connect_BTN.Text = "Connect"
Timer1.Enabled = False
Timer_LBL.Text = "Timer: OFF"
End If
End Sub
nathancamp solution works like a charm. Just tried it my self after downloading VisualStudio and loading the project. Kudos to Nathan.
Thanks a lot Nathan, it works perfectly now.
Praise to you
nunzio
thanks nathan, work perfectly!