include Wire h include Liquid CrystalI 2 C

  • Slides: 18
Download presentation

특수문자 이해하기 특수문자 생성하기 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid.

특수문자 이해하기 특수문자 생성하기 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); lcd를 이용하기 위한 기본 세팅을 합니다. 7

특수문자 이해하기 특수문자 void setup() { lcd. begin(); lcd. backlight(); lcd. create. Char(0, mychar);

특수문자 이해하기 특수문자 void setup() { lcd. begin(); lcd. backlight(); lcd. create. Char(0, mychar); } void loop() { lcd. clear(); lcd. home(); lcd. write(0); delay(1000); } setup에 lcd. create. Char(0, mychar); 를 사용합니다. lcd. create. Char(0, mychar); 을 씀으로써 mychar를 불러와서 0번에 저장하게 됩니다. 작업을 마치고 실행을 하면 특수 문자가 나타납니다. 9

특수문자 이해하기 특수문자 8가지 특수문자 출력 #include <Wire. h> #include <Liquid. Crystal_I 2 C.

특수문자 이해하기 특수문자 8가지 특수문자 출력 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); uint 8_t uint 8_t bell[8] = {0 x 4, 0 xe, 0 x 1 f, 0 x 0, 0 x 4}; note[8] = {0 x 2, 0 x 3, 0 x 2, 0 xe, 0 x 1 e, 0 xc, 0 x 0}; clock[8] = {0 x 0, 0 xe, 0 x 15, 0 x 17, 0 x 11, 0 xe, 0 x 0}; heart[8] = {0 x 00, 0 x 0 a, 0 x 1 f, 0 x 0 e, 0 x 04, 0 x 00}; duck[8] = {0 x 00, 0 x 0 c, 0 x 1 d, 0 xf, 0 x 06, 0 x 00}; check[8] = {0 x 00, 0 x 01, 0 x 03, 0 x 16, 0 x 1 c, 0 x 08, 0 x 00}; cross[8] = {0 x 00, 0 x 1 b, 0 x 0 e, 0 x 04, 0 x 0 e, 0 x 1 b, 0 x 00}; retarrow[8] = {0 x 01, 0 x 05, 0 x 09, 0 x 1 f, 0 x 08, 0 x 04, 0 x 00}; 임의의 모양 특수문자 8개를 만들어 줍니다. 11

특수문자 이해하기 특수문자 void setup() { lcd. begin(); lcd. backlight(); lcd. create. Char(0, bell);

특수문자 이해하기 특수문자 void setup() { lcd. begin(); lcd. backlight(); lcd. create. Char(0, bell); lcd. create. Char(1, note); lcd. create. Char(2, clock); lcd. create. Char(3, heart); lcd. create. Char(4, duck); lcd. create. Char(5, check); lcd. create. Char(6, cross); lcd. create. Char(7, retarrow); lcd. home(); lcd. print("Hello world. . . "); lcd. set. Cursor(0, 1); lcd. print(" i "); lcd. write(3); lcd. print(" SPL-Duino!"); delay(5000); } setup에서 만든 특수문자들을 lcd. create. Char에 저장하여 줍니다. 12

응용 작품 만들기 실습 • 코드 예시 #include <Wire. h> #include <Liquid. Crystal_I 2

응용 작품 만들기 실습 • 코드 예시 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); int green = 720; int blue = 658; int white = 900; int yellow = 797; int red = 603; int int mv=6; cnt=0; bnk=0; tone_on=0; int int alarm=1; alarm_h=0; alarm_m=0; alarm_s=0; 18