The reading of the color components is done via a TCP request to the board. The reading returns a frequency in KHz proportional to the intensity of the color. The frequencies in KHz are returned in a JSON string. The value of the intensity for all colors is also returned. Percentage components of color can be calculated from the frequency readings as these are proportional to the color intensity.
The sequence for reading is done by sending the following strings via TCP on port 9999:
acquire
(wait 5 seconds for acquisition to complete)
readf to read the frequency values
readp to read the percent values
The return message is in JSON format as follows:
Frequency:
{"RGBF": [{ "Red:": "1640", "Green": "1230", "Blue:": "2250", "All:": "6250"}]}}]}
each number representing a frequency in KHz proportional to the intensity of the light for red, green, blue and unfiltered (all).
Percentage:
{"RGBP": [{ "Red:": "33", "Green": "42", "Blue:": "25"}]}}]}
each number representing a percentage of the intensity of the light for red, green, blue.