i use slave receiver code ,i want to turn incoming characters to one string ..i Succeeded to do that but the string wont print in one line ..how can i print my string in one line .. thanks in advance.
this is the code :
#include <Wire.h>
void setup()
{
Wire.begin(4); // join i2c bus with address #4
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}
void loop()
{
delay(100);
}
void receiveEvent(int howMany)
{
while (1 < Wire.available())
{
char c = Wire.read();
String string="";
string+=char(c);
//String string="xis";
Serial.println(string);
delay(300);
}
int x = Wire.read();
}
