Hi Guys,
I am new to this forum, hello to all you super guru's. I have had B4A for quite some time but have struggled getting in to it. I am more of a hardware person, but do have experience with C.
My requirement is as follows:
I have 5 seekbars, I want to use each seek bar to control a channel of my garden lighting system. The goal is to have a mood type settings within the android app. So once the seekbar values have been set through the user interface, the seekbar values 1 - 5 can be stored against a specific mood number.
UPD protocol will be used to send the data to my hardware control unit. This part is all working and not a problem.
A typical UDP command would be : Garden-Node;setpwm;4;1023; 4 represents the chan and 1023 the value.
Tinkering with B4A, I can send simple UDP commands. The tricky bit is forming the string of data to send.
I have created a subroutine, and I am sure you can help me with this, It throws a moan
Sub Update_Seekbar(vChan As Int, vValue As Int)
Dim Packet As UDPPacket
Dim Dest As String
Dim data() As Byte
data = "All;setpwm;",vChan,";",vValue,";".GetBytes("UTF8")
' data = "All;allon;".GetBytes("UTF8")
Dest = "255.255.255.255"
Packet.Initialize(data, Dest, 12345)
UDPSocket1.Send(Packet)
End Sub
Any Advice and help will be so much appreciated. I will grasp it, possibly will take a little time.
Thanks in advance.
Dans
I am new to this forum, hello to all you super guru's. I have had B4A for quite some time but have struggled getting in to it. I am more of a hardware person, but do have experience with C.
My requirement is as follows:
I have 5 seekbars, I want to use each seek bar to control a channel of my garden lighting system. The goal is to have a mood type settings within the android app. So once the seekbar values have been set through the user interface, the seekbar values 1 - 5 can be stored against a specific mood number.
UPD protocol will be used to send the data to my hardware control unit. This part is all working and not a problem.
A typical UDP command would be : Garden-Node;setpwm;4;1023; 4 represents the chan and 1023 the value.
Tinkering with B4A, I can send simple UDP commands. The tricky bit is forming the string of data to send.
I have created a subroutine, and I am sure you can help me with this, It throws a moan
Sub Update_Seekbar(vChan As Int, vValue As Int)
Dim Packet As UDPPacket
Dim Dest As String
Dim data() As Byte
data = "All;setpwm;",vChan,";",vValue,";".GetBytes("UTF8")
' data = "All;allon;".GetBytes("UTF8")
Dest = "255.255.255.255"
Packet.Initialize(data, Dest, 12345)
UDPSocket1.Send(Packet)
End Sub
Any Advice and help will be so much appreciated. I will grasp it, possibly will take a little time.
Thanks in advance.
Dans