I have a simple robot project I am trying t do.
The section I am stuck on is getting the drive control data from the remote into the robot controller.
The remote is a "Nunchuck". I read it's joystick values and 2 of it's button states via I2C with a Arduino Pro Micro. I then build that data into a string and send all of it over an HC-05 Bluetooth pair. That piece I have working well. The data string is looks like this:
127,128,0,0
The first value is X joystick, second is Y joystick and the last two are the button states and can be 0 or 1.
I send these with a Serial1.println(nunchuckValues);
My question is, how can I parse these values out of the received string on th robot controller (Samd21).
I know how to convert the individual "substrings" into integers/bytes etc. once I have them broken out. I just am having a heck of a time finding a simple way to split this string on the delimiter of ",". I have done this multiple times in Python, but as we know, Arduino isn't running python.