A small library for working with cheap thermal "A2" printers, such as those available from Adafruit and Sparkfun.
serial_connection = .("/dev/serial") printer = .(serial_connection) printer.begin printer.println("Hello world!") printer.feed printer.bold_on printer.println("BOOM!") printer.bold_off
Writing to a file
This can be useful if you're going to use some other mechanism to send the bytes to the printer
commands_file = File.open("serial_commands.data", "w") printer = .(commands_file) printer.begin printer.println("Hello world!") # etc ... commands_file.close