Android Question BLE + SeekBar1 (Solved)

f0raster0

Well-Known Member
Licensed User
Longtime User
Hello Guys,
I am looking for an option to write a value in my BLE modules from a SeekBar, but can't make it work.
My try:

in Main I have:
B4X:
Sub SeekBar1_ValueChanged (Value As String, UserChanged As Boolean)
    Label4.Text= Value
    perc=Value
End Sub

Sub ButtonLedPorcentaje_Click
    CallSub(Starter, "WritePercent")

End Sub

in Starter I have:
B4X:
Public Sub WritePercent
    manager.WriteData("6e400001-b5a3-f393-e0a9-e50e24dcca9e", "6e400002-b5a3-f393-e0a9-e50e24dcca9e", Main.perc.GetBytes("UTF8"))
    Log("Main.perc - %")

End Sub

I'm getting this error when I try to change the value of SeekBar1
Note: using the App of Nordic Semiconductor my modules works fine. I can send any value between 0-100 to control a digital potentiometer. Want to do the same using B4A.
Edit1: I'm using the example https://www.b4x.com/android/forum/threads/ble-2-bluetooth-low-energy.59937/


Thank you
 
Last edited:

JohnC

Expert
Licensed User
Longtime User
The "signature" is how an event sub name and it's parameter variable types are defined.

I think the variable type for the parameter "Value" in the "Sub SeekBar1_ValueChanged (Value As String, UserChanged As Boolean)" should be an Int instead of a string
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…