Hybrid image(Lion & Mona Lisa) - AS-289R2 Thermal Printer Shield

Dependencies:   AS289R2 mbed

Committer:
takehiro
Date:
Sun May 21 06:02:15 2017 +0000
Revision:
0:8066c575567f
Hybrid image(Lion & Mona Lisa) - AS-289R2 Thermal Printer Shield

Who changed what in which revision?

UserRevisionLine numberNew contents of line
takehiro 0:8066c575567f 1 /* Sample program
takehiro 0:8066c575567f 2 * Hybrid image
takehiro 0:8066c575567f 3 * AS-289R2 Thermal Printer Shield
takehiro 0:8066c575567f 4 * NADA ELECTRONICS, LTD.
takehiro 0:8066c575567f 5 * Copyright (c) 2017 Takehiro Yamaguchi, MIT License
takehiro 0:8066c575567f 6 */
takehiro 0:8066c575567f 7
takehiro 0:8066c575567f 8 #include "mbed.h"
takehiro 0:8066c575567f 9 #include "AS289R2.h"
takehiro 0:8066c575567f 10 #include "image.h" // MonochromeBitmap to cpp : http://www.nada.co.jp/as289r2/en/ex_bitmap.html
takehiro 0:8066c575567f 11
takehiro 0:8066c575567f 12 /* NUCLEO-F746ZG */
takehiro 0:8066c575567f 13 AS289R2 tp(D1);
takehiro 0:8066c575567f 14
takehiro 0:8066c575567f 15 DigitalOut myled(LED1);
takehiro 0:8066c575567f 16
takehiro 0:8066c575567f 17 int main()
takehiro 0:8066c575567f 18 {
takehiro 0:8066c575567f 19 /* initialize */
takehiro 0:8066c575567f 20 tp.initialize();
takehiro 0:8066c575567f 21 tp.putLineFeed(2);
takehiro 0:8066c575567f 22
takehiro 0:8066c575567f 23 /* Hybrid image */
takehiro 0:8066c575567f 24 int lines = hybridimage_len / 48;
takehiro 0:8066c575567f 25 tp.printBitmapImage(0x63, lines, hybridimage);
takehiro 0:8066c575567f 26 tp.putLineFeed(6);
takehiro 0:8066c575567f 27
takehiro 0:8066c575567f 28 while(1) {
takehiro 0:8066c575567f 29 myled = 1; // LED is ON
takehiro 0:8066c575567f 30 wait(0.2); // 200 ms
takehiro 0:8066c575567f 31 myled = 0; // LED is OFF
takehiro 0:8066c575567f 32 wait(1.0); // 1 sec
takehiro 0:8066c575567f 33 }
takehiro 0:8066c575567f 34 }