Thermal Printer + Processing - breaks every third time


I’m absolutely flummoxed.

I’ve a thermal printer connected to my Uno and its talking to Processing. This is the tutorial that I’ve used to connect them Connecting Arduino to Processing -

For my project, I’m playing an audio track. When it reaches 10 seconds, I send a character to Arduino to print something, when it reach 20 seconds I send a command to print something else, and the same when it reaches 35 seconds.

So, track begins to play, 10 seconds == print, 20 seconds == print, 35 seconds == print.

This process works fine for the first two times, but on the third time it doesn’t get past the 20 second mark.

I have no idea what is it wrong with it. I’m putting a delay(2000); in each time I print.

I’m using the Adafruit Thermal Printer Library

These code extracts will give you an idea of how I’m controlling the printing process:

Processing code: posRound is the amount of seconds that have passed in the track

if(posRound == 20){
      println("its 20 seconds in");
      println("print again");

Arduino Code:

if(val == '6'){
      digitalWrite(LED_13, HIGH);
      printer.println("Keep churning!");
      digitalWrite(LED_13, LOW);

If anyone has any ideas I’d love to hear of them!

Please post the whole code as that helps to diagnose it Also add links to the libraries used (as not everyone has the same libs)

Ok, I didn’t post the code first because there is lots of it there.

The thermal printer library I’m using : GitHub - adafruit/Adafruit-Thermal-Printer-Library: Arduino Library for Small Thermal Printers

I can’t post the code because it exceeds the maximum allowed length, so I’ll attach both the arduino and the Processing files and I’ll leave a link to a pastebin of them too:


churn_printer_test_3.ino (14 KB)

churn_minim_rfid_2.pde (8.1 KB)


I still don't know for certain what was causing the issue, but I recon that may have been with what I was trying to print on the Thermal Printer.

So I was trying to print strings like this :

String story5_link = "";

So I took that line out. Like, I'm still having problems, but less frequently.