AS-289R2プリンタシールド

GR-LYCHEE

がじぇっとるねさす
ARM mbed - GR-LYCHEE

AS-289R2のJP5をご確認ください。
ARM mbed用ライブラリ

/*
 * Thermal Printer Shield for mbed OS
 * Model:AS-289R2
 * Sample Sourcecode
 * Library : https://developer.mbed.org/components/AS-289R2-Thermal-Printer-Shield/
 * NADA ELECTRONICS, LTD.
 * http://www.nada.co.jp
 * By. Takehiro Yamaguchi
*/

#include "mbed.h"
#include "AS289R2.h"

DigitalOut led1(LED1);
AS289R2 tp(D1);

const char url[] = "https://developer.mbed.org/components/AS-289R2-Thermal-Printer-Shield/";

void AS289R2_demo()
{
    tp.initialize();
    tp.putLineFeed(2);

    /* Text Print */
    tp.printf("Thermal Printer Shield\r");
    tp.printf("Model:AS-289R2\r");
    tp.putLineFeed(4);

    tp.setANKFont(AS289R2::ANK_8x16);
    tp.printf(" 8x16: ABCDEF 012345\r");
    tp.setANKFont(AS289R2::ANK_12x24);
    tp.printf("12x24: ABCDEF 012345\r");
    tp.setANKFont(AS289R2::ANK_16x16);
    tp.printf("16x16: ABCDEF 012345\r");
    tp.setANKFont(AS289R2::ANK_24x24);
    tp.printf("24x24: ABCDEF 012345\r");
    tp.putLineFeed(4);

    tp.setANKFont(AS289R2::ANK_12x24);
    tp.printf("AS-289R2\r");
    tp.setDoubleSizeWidth();
    tp.printf("AS-289R2\r");
    tp.clearDoubleSizeWidth();
    tp.setDoubleSizeHeight();
    tp.printf("AS-289R2\r");
    tp.clearDoubleSizeHeight();
    tp.setQuadrupleSize();
    tp.printf("AS-289R2\r");
    tp.clearQuadrupleSize();
    tp.setEnlargement(3, 3);
    tp.printf("AS-289R2\r");
    tp.clearEnlargement();
    tp.putLineFeed(4);

    /* 日本語 Print */
    tp.setKanjiFont(AS289R2::KANJI_16x16);
    tp.printf("Japanese Language\r");
    tp.printf("16x16: 日本語印字\r");
    tp.setKanjiFont(AS289R2::KANJI_24x24);
    tp.printf("24x24: 日本語印字\r");
    tp.putLineFeed(4);

    /* QR code */
    tp.setANKFont(AS289R2::ANK_8x16);
    tp.printf("QR\r");
    tp.printQRCode(AS289R2::QR_ERR_LVL_M, url);
    tp.printf("\r%s\r", url);
    tp.putLineFeed(4);

    /* Barcode */
    tp.printf("Barcode UPC-A\r");
    tp.printBarCode(AS289R2::BCODE_UPC_A, "01234567890");
    tp.printf("Barcode JAN13\r");
    tp.printBarCode(AS289R2::BCODE_JAN13, "123456789012");
    tp.printf("Barcode JAN8\r");
    tp.printBarCode(AS289R2::BCODE_JAN8, "1234567");
    tp.printf("Barcode CODE39\r");
    tp.printBarCode(AS289R2::BCODE_CODE39, "123456");
    tp.printf("Barcode ITF\r");
    tp.printBarCode(AS289R2::BCODE_ITF, "01234567890123");
    tp.printf("Barcode CODABAR(NW7)\r");
    tp.printBarCode(AS289R2::BCODE_CODABAR, "A0123456789A");
    tp.putLineFeed(4);

}

// main() runs in its own thread in the OS
// (note the calls to wait below for delays)
int main()
{
    AS289R2_demo();
    while (true) {
        led1 = !led1;
        wait(0.5);
    }
}

GR-PEACH

がじぇっとるねさす
ARM mbed - GR-PEACH



AS-289R2のJP5をご確認ください。
CN1の足を少しカットし、LEDスペーサー6mmを使用することで、RJ-45コネクタとの干渉を防止出来ます。
ARM mbed用ライブラリ

/*
 * Thermal Printer Shield for mbed OS
 * Model:AS-289R2
 * Sample Sourcecode
 * Library : https://developer.mbed.org/components/AS-289R2-Thermal-Printer-Shield/
 * NADA ELECTRONICS, LTD.
 * http://www.nada.co.jp
 * By. Takehiro Yamaguchi
*/

#include "mbed.h"
#include "AS289R2.h"

DigitalOut led1(LED1);
AS289R2 tp(D1);

const char url[] = "https://developer.mbed.org/components/AS-289R2-Thermal-Printer-Shield/";

void AS289R2_demo()
{
    tp.initialize();
    tp.putLineFeed(2);

    /* Text Print */
    tp.printf("Thermal Printer Shield\r");
    tp.printf("Model:AS-289R2\r");
    tp.putLineFeed(4);

    tp.setANKFont(AS289R2::ANK_8x16);
    tp.printf(" 8x16: ABCDEF 012345\r");
    tp.setANKFont(AS289R2::ANK_12x24);
    tp.printf("12x24: ABCDEF 012345\r");
    tp.setANKFont(AS289R2::ANK_16x16);
    tp.printf("16x16: ABCDEF 012345\r");
    tp.setANKFont(AS289R2::ANK_24x24);
    tp.printf("24x24: ABCDEF 012345\r");
    tp.putLineFeed(4);

    tp.setANKFont(AS289R2::ANK_12x24);
    tp.printf("AS-289R2\r");
    tp.setDoubleSizeWidth();
    tp.printf("AS-289R2\r");
    tp.clearDoubleSizeWidth();
    tp.setDoubleSizeHeight();
    tp.printf("AS-289R2\r");
    tp.clearDoubleSizeHeight();
    tp.setQuadrupleSize();
    tp.printf("AS-289R2\r");
    tp.clearQuadrupleSize();
    tp.setEnlargement(3, 3);
    tp.printf("AS-289R2\r");
    tp.clearEnlargement();
    tp.putLineFeed(4);

    /* 日本語 Print */
    tp.setKanjiFont(AS289R2::KANJI_16x16);
    tp.printf("Japanese Language\r");
    tp.printf("16x16: 日本語印字\r");
    tp.setKanjiFont(AS289R2::KANJI_24x24);
    tp.printf("24x24: 日本語印字\r");
    tp.putLineFeed(4);

    /* QR code */
    tp.setANKFont(AS289R2::ANK_8x16);
    tp.printf("QR\r");
    tp.printQRCode(AS289R2::QR_ERR_LVL_M, url);
    tp.printf("\r%s\r", url);
    tp.putLineFeed(4);

    /* Barcode */
    tp.printf("Barcode UPC-A\r");
    tp.printBarCode(AS289R2::BCODE_UPC_A, "01234567890");
    tp.printf("Barcode JAN13\r");
    tp.printBarCode(AS289R2::BCODE_JAN13, "123456789012");
    tp.printf("Barcode JAN8\r");
    tp.printBarCode(AS289R2::BCODE_JAN8, "1234567");
    tp.printf("Barcode CODE39\r");
    tp.printBarCode(AS289R2::BCODE_CODE39, "123456");
    tp.printf("Barcode ITF\r");
    tp.printBarCode(AS289R2::BCODE_ITF, "01234567890123");
    tp.printf("Barcode CODABAR(NW7)\r");
    tp.printBarCode(AS289R2::BCODE_CODABAR, "A0123456789A");
    tp.putLineFeed(4);

}

// main() runs in its own thread in the OS
// (note the calls to wait below for delays)
int main()
{
    AS289R2_demo();
    while (true) {
        led1 = !led1;
        wait(0.5);
    }
}

GR-GR-CITRUS

がじぇっとるねさす

AS-289R2のJP5をご確認ください。

/* GR-CITRUS Sketch Template V1.00 */

/*
 * Thermal Printer Shield for GR-CITRUS
 * Model:AS-289R2 & AS-289R
 * Sample Sourcecode
 * NADA ELECTRONICS, LTD.
 * http://www.nada.co.jp
 * By. Takehiro Yamaguchi
*/
 
#include 
 
void setup()
{
    Serial1.begin(9600);
}
 
void loop()
{
  /* Text Print */
  Serial1.print("Thermal Printer Shield\r");
  Serial1.print("Text Printing.\r");
  Serial1.print("\r\r");     // Line Feed x 2
  /* QRcode Print */
  byte GsQr[] = { 0x1D,0x78,0x4C,0x04,0x54,0x45,0x53,0x54 };
  Serial1.write(GsQr, 8);
  Serial1.print("\r\r\r\r\r\r");  // Line Feed x 6
  /* Wait */
  delay(5000);  // 5sec
}

GR-COTTON

がじぇっとるねさす

AS-289R2のJP5をご確認ください。

/*GR-COTTON Sketch Template Version: E0.10*/

/*
 * Thermal Printer Shield for GR-COTTON
 * Model:AS-289R2 & AS-289R
 * Sample Sourcecode
 * NADA ELECTRONICS, LTD.
 * http://www.nada.co.jp
 * By. Takehiro Yamaguchi
*/

#include <Arduino.h>

void setup()
{
    Serial1.begin(9600);
}

void loop()
{
  /* Text Print */
  Serial1.print("Thermal Printer Shield\r");
  Serial1.print("Text Printing.\r");
  Serial1.print("\r\r");     // Line Feed x 2
  /* QRcode Print */
  byte GsQr[] = { 0x1D,0x78,0x4C,0x04,0x54,0x45,0x53,0x54 };
  Serial1.write(GsQr, 8);
  Serial1.print("\r\r\r\r\r\r");  // Line Feed x 6
  /* Wait */
  delay(5000);  // 5sec
}

GR-KAEDE

がじぇっとるねさす

AS-289R2のJP5をご確認ください。

/* GR-KAEDE Sketch Template V1.00 */

/*
 * Thermal Printer Shield for GR-KAEDE
 * Model:AS-289R2 & AS-289R
 * Sample Sourcecode
 * NADA ELECTRONICS, LTD.
 * http://www.nada.co.jp
 * By. Takehiro Yamaguchi
*/

#include <Arduino.h>

void setup()
{
	Serial1.begin(9600);
}

void loop()
{
	/* Text Print */
	Serial1.print("Thermal Printer Shield\r");
	Serial1.print("Text Printing.\r");
	Serial1.print("\r\r");     // Line Feed x 2
	/* QRcode Print */
	byte GsQr[] = { 0x1D,0x78,0x4C,0x04,0x54,0x45,0x53,0x54 };
	Serial1.write(GsQr, 8);
	Serial1.print("\r\r\r\r\r\r");  // Line Feed x 6
	/* Wait */
	delay(5000);  // 5sec
}

GR-SAKURA

がじぇっとるねさす

AS-289R2のJP5をご確認ください。

/* GR-SAKURA Sketch Template V2.00 */

/*
 * Thermal Printer Shield for GR-SAKURA Library V2
 * Model:AS-289R2 & AS-289R
 * Sample Sourcecode
 * NADA ELECTRONICS, LTD.
 * http://www.nada.co.jp
 * By. Takehiro Yamaguchi
*/

#include <Arduino.h>

void setup()
{
    Serial1.begin(9600);
}

void loop()
{
  /* Text Print */
  Serial1.print("Thermal Printer Shield\r");
  Serial1.print("Text Printing.\r");
  Serial1.print("\r\r");     // Line Feed x 2
  /* QRcode Print */
  byte GsQr[] = { 0x1D,0x78,0x4C,0x04,0x54,0x45,0x53,0x54 };
  Serial1.write(GsQr, 8);
  Serial1.print("\r\r\r\r\r\r");  // Line Feed x 6
  /* Wait */
  delay(5000);  // 5sec
}