Thanks.An Arduino is a good solution as it includes a USB to serial chip. You can then use felUsbSerial library on the B4A side and write a simple B4R program that will control the led.
felusbserial library is working for me with a Digispark (attiny 85) and Initialize2(..."CDCSerialDevice"...)Not sure. You can see the API here: https://www.b4x.com/android/help/felusbserial.html
Are you using an OTG cable with this or does the Digispark plug directly into the USB connection on the phone/device?felusbserial library is working for me with a Digispark (attiny 45) and Initialize2(..."CDCSerialDevice"...)
Thank you for your help
![]()
Directly into the USb --> OKAre you using an OTG cable with this or does the Digispark plug directly into the USB connection on the phone/device?
Yes, thank you but I want to use the usb port.you can use HC-6 Bluetooth module and connect it to your led board.. your led board must have RS485 port, then connect the four pins of the CH-6 to your boards serial port.
View attachment 44342
Wireless means with battery ...Any special reason to need a USB port when you can turn the LED "ON" wirelessly by Bluetooth? I thought BT is more convenient because no wires required
besides it goes further than USB cable.
Thank you for your help.Some detailed information about your Android device can help.
... On minix 5, it's ok ...Good work! Thanks for sharing![]()
Thanks.Still the tech specs of your led board is important.. Because you want to interface to the board then it's important to know the pinout of the board and inner finctions if sny.
If you just want to turn on and off single led then you can use the audeo jack, send audio frequency from the phone and rectify it with bridge diode and connect the out to tge led.. If multiple leds you can send different frequencies and filter them in the led board and then send tge dc signsl to the different leds.
can you tell me how you did it?felusbserial library is working for me with a Digispark (attiny 85) and Initialize2(..."CDCSerialDevice"...)
Thank you for your help
![]()
Hello,can you tell me how you did it?
Sub Process_Globals
Private usbserial As felUsbSerial
Private manager As UsbManager
...
Sub Service_Create
manager.Initialize
GetUsb
...
Sub GetUsb
' Pas de USb ?
If manager.GetDevices.Length = 0 Then
ToastMessageShow("Please connect usb device and try again.", True)
Else
' Pas autorisation USB
Dim device As UsbDevice
For i=0 To manager.GetDevices.Length-1
device = manager.GetDevices(i)
' ToastMessageShow(i & " : " & device.VendorId & " - " & device.ProductId, True)
' If device.VendorId = 5840 And device.ProductId = 1875 Then ' Digispark 16d0=5840 et 0753=1875
If device.VendorId = 5840 And device.ProductId = 2174 Then ' Digispark 16d0=5840 et 087E=2174
If manager.HasPermission(device) = False Then
ToastMessageShow("Please allow connection and try again.", True)
manager.RequestPermission(device)
Else
UsbOk = True
usbserial.Initialize2("serial", device, -1, "CDCSerialDevice")
End If
End If
Exit
Next
End If
End Sub