Using MATLAB you can read in the latest color or do analysis on CheerLights to discover popular colors and how long colors get displayed during the day. To use CheerLights with MATLAB, install the ThingSpeak Support Toolbox. Once you install the toolbox, you will have access to the “thingSpeakRead” function. This is what you will use to read the latest colors into MATLAB.
Here’s some quick MATLAB code to read in the latest color from CheerLights:
latestCheer = thingSpeakRead(1417, 'outputFormat', 'table'); currentColor = latestCheer.LastCheerLightsCommand