Created
April 1, 2014 19:33
-
-
Save simonjgreen/9921372 to your computer and use it in GitHub Desktop.
Arduino printer quick ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test inverse on & off | |
printer.inverseOn(); | |
printer.println("Inverse ON"); | |
printer.inverseOff(); | |
// Test character double-height on & off | |
printer.doubleHeightOn(); | |
printer.println("Double Height ON"); | |
printer.doubleHeightOff(); | |
// Set text justification (right, center, left) -- accepts 'L', 'C', 'R' | |
printer.justify('R'); | |
printer.println("Right justified"); | |
printer.justify('C'); | |
printer.println("Center justified"); | |
printer.justify('L'); | |
printer.println("Left justified"); | |
// Test more styles | |
printer.boldOn(); | |
printer.println("Bold text"); | |
printer.boldOff(); | |
printer.underlineOn(); | |
printer.println("Underlined text "); | |
printer.underlineOff(); | |
printer.setSize('L'); // Set type size, accepts 'S', 'M', 'L' | |
printer.println("Large"); // Print line | |
printer.setSize('M'); | |
printer.println("Medium"); | |
printer.setSize('S'); | |
printer.println("Small"); | |
printer.justify('C'); | |
printer.println("normal\nline\nspacing"); | |
printer.setLineHeight(50); | |
printer.println("Taller\nline\nspacing"); | |
printer.setLineHeight(); // Reset to default | |
printer.justify('L'); | |
// Barcode examples | |
printer.feed(1); | |
// CODE39 is the most common alphanumeric barcode | |
printer.printBarcode("ADAFRUT", CODE39); | |
printer.setBarcodeHeight(100); | |
// Print UPC line on product barcodes | |
printer.printBarcode("123456789123", UPC_A); | |
// Print the 75x75 pixel logo in adalogo.h | |
printer.printBitmap(adalogo_width, adalogo_height, adalogo_data); | |
// Print the 135x135 pixel QR code in adaqrcode.h | |
printer.printBitmap(adaqrcode_width, adaqrcode_height, adaqrcode_data); | |
printer.println("Adafruit!"); | |
printer.feed(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment