Hi everyone,
I use Uno to connect some sensors (like pressure sensor) and then transfer the data to MEGA via I2C.
Subsequently, I would like to implement mini thermal receipt printer to print out the data on sheets.
The link below is the information about the currently used printer
However, I have difficulties getting it right.
If it is written as printer.println(c);
MEGA can not read the data transferred from Uno, and printer only print the first character.
(ex. "P" out of "Pressure")
If printer.println(c); is removed, MEGA is able to read the data.
The printer should be fine because the printer prints "start" according to the script printer.println("start");
void receiveEvent(int howMany)
{
while (Wire.available())
{
// receive one byte from Master
incomingByte = Wire.read();
Serial.write(incomingByte);
Serial.println(incomingByte);
}
}
.
salve_read.ino (1.2 KB)