I am working on a program that communicates with a device connected through USB. When my program reads in data sent from the device (button presses, for example), it is sent as a byte array. I have key value pairs stored as a dictionary for the button press byte array and a string for the name of the button, which I display whenever it is pressed. This device also has sliders which sends byte arrays, but it has a full range, each slider is a different digit in the array
{ 3, 0, 0, 0, FF, 0, 0, 0 }
The range goes from 00 to FF in hex which I convert to decimal.
byte[] slider1rangeLower = { 3, 0, 0, 0, 00, 0, 0, 0 }
byte[] slider1rangeUpper = { 3, 0, 0, 0, 255, 0, 0, 0 }
byte[] slider2rangeLower = { 3, 0, 0, 00, 0, 0, 0, 0 }
byte[] slider2rangeUpper = { 3, 0, 0, 255, 0, 0, 0, 0 }
I need to know what slider is being used, so every value between 0-255 comes through as "slider1" or whatever the name might be. Is there any way to store a whole range of values for one object, as opposed to making 256 entries per slider?