Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15667

Basic variable problem

$
0
0
Hi all. :wave:

There is a byte variable as follow
Code:

Dim Sendcmd() As Byte = { 0, 0, 0, 0 }
which need to be called in
Code:

SerialPort1.Write(Sendcmd, 0, Sendcmd.Lenght - 1)
The question is how to change "0"s with a set of TrackBar controls changeable values?

What I tried and failed:
Code:

Dim Sendcmd() As Byte = {CByte(TrackBar1.Value), CByte(TrackBar2.Value), CByte(TrackBar3.Value), CByte(TrackBar4.Value)}
Code:

Dim Sendcmd() As Byte = {(TrackBar1.Value).ToString, (TrackBar2.Value).ToString, (TrackBar3.Value).ToString, (TrackBar4.Value).ToString}

Viewing all articles
Browse latest Browse all 15667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>