My ardunio due is connected to the adafruit thermal printer and is printing gibberish when I run basic code, but the self test page and serial monitor entries print just fine so I think I have my connections mixed up. I am using the programming port connected to my MacBook and my RX is in 0 and my TX is in 1. Here is the code:
#include "Adafruit_Thermal.h"
#include "adalogo.h"
#include "adaqrcode.h"
#include "test5.h"
//#define TX_PIN 1 // Arduino transmit YELLOW WIRE labeled RX on printer
//#define RX_PIN 0 // Arduino receive GREEN WIRE labeled TX on printer
//
//SoftwareSerial mySerial(RX_PIN, TX_PIN); // Declare SoftwareSerial obj first
//Adafruit_Thermal printer(&mySerial); // Pass addr to printer constructor
Adafruit_Thermal printer(&Serial1);
void setup() {
// pinMode(7, OUTPUT); digitalWrite(7, LOW);
// Serial.begin(19200); // Initialize SoftwareSerial
Serial1.begin(19200); // Use this instead if using hardware serial
printer.begin(); // Init printer (same regardless of serial type)
// Font options
printer.setFont('A');
printer.inverseOff();
printer.doubleHeightOff();
// Set text justification (right, center, left) -- accepts 'L', 'C', 'R'
printer.justify('L');
printer.boldOff();
printer.setSize('S');
printer.setLineHeight(); // Reset to default
// Print the bitmap image:
// printer.printBitmap(test5_width, test5_height, test5_data);
printer.println("caption goes here");
printer.feed(2);
printer.sleep(); // Tell printer to sleep
delay(3000L); // Sleep for 3 seconds
printer.wake(); // MUST wake() before printing again, even if reset
printer.setDefault(); // Restore printer to defaults
}
void loop() {
}
I need all the help I can get. Working with Arduino is fun but I am a beginner and this is for my capstone project. I was able to get everything working when I used the UNO R# but it didn't have enough memory for my prints so I switched to the Due.