I am receiving a comma separated string eg "100,150,175,200" from a PC via USB:
I am trying to get it into an array such as:
dim i(3) as int
dim count as int
Dim c As String = (JoinStrings(Array As String(BC.StringFromBytes(Buffer))))
from the tutorial I can split it around the comma:
For Each s() As Byte In bcx.Split(c,",")
count = count + 1
i(count) = s
R.AnalogWrite(i(count))
G.AnalogWrite(i(count))
B.AnalogWrite(i(count))
W.AnalogWrite(i(count))
next
This doesn't work (Cannot cast type). There must be a more elegant way of doing this.
Hopefully it is obvious what I am trying to do-write the values of the string to 4 pwm outputs.
How might I acheive this.
Many thanks
I am trying to get it into an array such as:
dim i(3) as int
dim count as int
Dim c As String = (JoinStrings(Array As String(BC.StringFromBytes(Buffer))))
from the tutorial I can split it around the comma:
For Each s() As Byte In bcx.Split(c,",")
count = count + 1
i(count) = s
R.AnalogWrite(i(count))
G.AnalogWrite(i(count))
B.AnalogWrite(i(count))
W.AnalogWrite(i(count))
next
This doesn't work (Cannot cast type). There must be a more elegant way of doing this.
Hopefully it is obvious what I am trying to do-write the values of the string to 4 pwm outputs.
How might I acheive this.
Many thanks