Back to Parent

Built-In RGB LED

I only did one experiment, the built-in RGB LED for the bonus part since my RGB LED has not arrived.

I read the tutorial that handles the input of three RGB values and find out it is quite smart. However, I decide to use an alternative method to parse the command input.

The function I use is strtok(). It uses "tokens" to parse a character array and get the value between the delimiter.

The function strtok() only works for character array pointer so I convert the command input from string to character array using .toCharArray(). The delimiter in our input is "," so we can get the three numbers around the two ",".

The outcome is shown in the video.


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0