I have an Adafruit Thermal Printer that I’m connecting to my Electron. I’m sending lines to the printer to print, but the printer isn’t printing them. I have the printer’s green and yellow wires connected the the Electron’s Serial1 TX and RX pins. Here’s my code:
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_Thermal.h>
Adafruit_Thermal printer;
bool ready = false;
int receiveMessage(String msg) {
Particle.publish("alex-message-received", msg, PUBLIC);
printer.println(msg);
printer.feed(2);
printer.setDefault();
return 1;
}
void setup() {
// Particle stuff
Particle.function("message", receiveMessage);
Particle.variable("ready", ready);
// Particle.connect();
Particle.publish("setup-particle-connected", "1", PUBLIC);
// Printer stuff
Serial1.begin(19200);
// begin(SERIAL_IMPL* serial, int heatTime=200)
printer.begin(&Serial1);
Particle.publish("setup-serial-printer-begin", "2", PUBLIC);
// Test message
printer.println("TEST MESSAGE");
printer.feed(2);
printer.setDefault();
Particle.publish("printed-test", "3", PUBLIC);
ready = true;
}
void loop() {
}
I’m seeing the events in the console, but no lines are printing out of the printer. What could I be missing? How can I confirm that the connection is solid?