I’m finding it hard to understand the different data types in Arduino.
I am using a library for a radio shield that receives data in the form of uint8_t variable which I understand is essentially the same as a unsigned char and a byte in Arduino.
I want to parse the incoming variable by the colon using strtok(). However, the first argument of strtok is required to be a char*.
Is there a way to convert the uint8_t variable to a char? or is there another function more suitable to parsing variables of type uint8_t? I cannot change the variable on the transmitter.
An example of the uint8_t variable is “temp:2.4,number:300,humidity:54.567”
I searched google but have been unable to find a solution.
I am using a library for a radio shield that receives data in the form of uint8_t variable
Very unlikely. A uint8_t ARRAY would make more sense.
A uint8_t and a char are the same size. So, it you have a function that expects a char array, and you have a uint8_t array, lie to the function, by using a cast.