There seems to be somewhat of an issue when i'm trying to add a char to a string. When this code uploads, nothing shows, but when using the Slave Receiver example, it reads what I want but without combining them together. My code is below. Code: while(Wire.available()) { char c = Wire.read(); result += c; //adds the read character to string to build full reading info. E.g. "2-20" } Serial.println(result); //prints result which is in turn picked up by control panel software result = ""; //reset string Any help would be greatly appreciated Ryan
Don't have access to my Udoo or arduino right now, but try this: Try casting the char to a string and using Concat: result.concat((String) c); That way you're appending a string to a string, rather than a char to a string. What sort of result are you seeing with the code you posted?
Thanks for your reply. I tried using the += and concat functions, and nothing at all would show, and if i attempted to modify the sketch, to just add a print statement, nothing at all would show. It essentially broke the sketch. I'll get it tested on my udoo tomorrow morning. Thanks! P.S I wrote the code on an Uno originally, and worked perfectly.