Thermal printer hello world program.

Dependencies:   Adafruit_Thermal_Printer mbed

Files at this revision

API Documentation at this revision

Comitter:
aross34
Date:
Wed Mar 16 01:43:45 2016 +0000
Child:
1:9ccf98857297
Commit message:
Hello world program for Adafruit thermal printer. Updated API documentation.

Changed in this revision

TEST_THERMAL.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TEST_THERMAL.lib	Wed Mar 16 01:43:45 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/aross34/code/Adafruit_Thermal_Printer/#de26317d87a6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 16 01:43:45 2016 +0000
@@ -0,0 +1,68 @@
+#include "mbed.h"
+#include "AdafruitThermal.h"
+
+DigitalOut myled(LED1);
+AdafruitThermal Printer(p9, p10);
+
+int main() {
+        myled = 1;
+        Printer.begin();
+        //Printer.test();
+        // **char *OutputText = "Better Work Dammit\n";
+        // **Printer.print(OutputText);
+        
+        char *Testing_Foo = "Hello World!\n";
+        Printer.print(Testing_Foo);
+        
+        Printer.justify('C');
+        char *Text_Out11 = "normal\nline\nspacing\n";
+        Printer.print(Text_Out11);
+        Printer.setLineHeight(50);
+        char *Text_Out12 = "Taller\nline\nspacing\n";
+        Printer.print(Text_Out12);
+        Printer.setLineHeight(); // Reset to default
+        Printer.justify('L');
+        
+        Printer.setSize('L');
+        char *Text_Out8 = "Large\n";
+        Printer.print(Text_Out8);
+        
+        Printer.setSize('M');
+        char *Text_Out9 = "Medium\n";
+        Printer.print(Text_Out9);
+        
+        Printer.setSize('S');
+        char *Text_Out10 = "Small\n";
+        Printer.print(Text_Out10);
+        
+        Printer.inverseOn();
+        char *Text_Out1 = "Inverse ON\n";
+        Printer.print(Text_Out1);
+        Printer.inverseOff();
+        
+        Printer.doubleHeightOn();
+        char *Text_Out2 = "Double Height ON\n";
+        Printer.print(Text_Out2);
+        Printer.doubleHeightOff();
+        
+        Printer.justify('R');
+        char *Text_Out3 = "Right Justified\n";
+        Printer.print(Text_Out3);
+        
+        Printer.justify('C');
+        char *Text_Out4 = "Center Justified\n";
+        Printer.print(Text_Out4);
+        
+        Printer.justify('L');
+        char *Text_Out5 = "Left Justified\n";
+        Printer.print(Text_Out5);
+        
+        Printer.boldOn();
+        char *Text_Out6 = "Bold Text\n";
+        Printer.print(Text_Out6);
+        Printer.boldOff();
+        
+        myled = 0;
+        
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 16 01:43:45 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/3d0ef94e36ec
\ No newline at end of file