I am trying to connect my Samsung tablet to a Leostick (Arduino) board from Freetronics via USB.
I am utilising the USBSerial library with the following code:
However while the device information is displayed by the first msgbox command, there appears to be a compatibility issue because "Error opening USB port" is displayed by the third msgbox command.
So is the Leostick board from Freetronics compatible with the USBSerial libray?
Do I need to use the usb.SetCustomDevice command and if so, what parameters would I use given usb.DeviceInfo throws up:
Device ID: 0x3EB
ProductId: 0x8002
VendorId: 0x26BA
I am utilising the USBSerial library with the following code:
B4X:
Sub GetData_Click
If usb.UsbPresent = usb.USB_NONE Then
Log("Msgbox - no device")
Msgbox("No USB device or accessory detected!", "Error")
Return
End If
Log("Checking permission")
If (usb.HasPermission) Then
Msgbox(usb.DeviceInfo, "Device Information")
Dim dev As Int
dev = usb.Open(115200)
If dev <> usb.USB_NONE Then
Msgbox("Connected successfully!", "Info")
astreams.Initialize(usb.GetInputStream, usb.GetOutputStream, "astreams")
Else
Msgbox("Error opening USB port", "Info")
End If
Else
usb.RequestPermission
End If
End Sub
However while the device information is displayed by the first msgbox command, there appears to be a compatibility issue because "Error opening USB port" is displayed by the third msgbox command.
So is the Leostick board from Freetronics compatible with the USBSerial libray?
Do I need to use the usb.SetCustomDevice command and if so, what parameters would I use given usb.DeviceInfo throws up:
Device ID: 0x3EB
ProductId: 0x8002
VendorId: 0x26BA