Hi everyone.
I'm trying to control some lights from (at the moment) one arduino to another via i2c by sending a String like this one 01111/255255255 (the length and the position will be always the same).
The comunication works perfect and I'm able to print the array of char that I'm receiving in the serial interface of the slave but the problem is that I don't know how to convert the data(the last 3 groups of 3 numbers) to the actual value in a byte or a int.
I would like to do something like this:
char inComming[15]; //received data
String red = inComming[6]+inComming[7]+inComming[8]; // concatenate the 3 numbers in a string
byte redValue = stringTobyte(red); // convert the string to the real value on a byte
//(I know it won't be that easy)
I've been messing around with some functions like strcat or sprintf without result (probably because I'm doing something wrong).
Any help?