AS-289R2 Thermal Printer shield control library

Dependents:   AS-289R2_Hello-World AS-289R2_Hello-World-mbed-OS hybrid_image_as289r2 microbit_AS-289R2 ... more

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Wed Jan 06 01:57:03 2021 +0000
Parent:
10:b7d6c02caf97
Commit message:
Fix missing parameter in printBarCode

Changed in this revision

AS289R2.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b7d6c02caf97 -r 4699cb4e4cfe AS289R2.cpp
--- a/AS289R2.cpp	Mon Jan 20 00:33:01 2020 +0900
+++ b/AS289R2.cpp	Wed Jan 06 01:57:03 2021 +0000
@@ -130,8 +130,9 @@
 
 void AS289R2::printBarCode(uint32_t code, const char* param)
 {
-    char buf[3] = {0x1D, 0x6B};
+    char buf[4] = {0x1D, 0x6B};
     buf[2] = code;
+    buf[3] = (code & 0x0F);
     for (uint32_t i = 0; i < sizeof(buf); i++) {
         _serial.putc(buf[i]);
     }