LCD LCD include Wire h include Liquid CrystalI

  • Slides: 24
Download presentation

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h>

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); void setup(); void loop(); void setup() { ns_stick. begin(); lcd. init(); //LCD 창에 헬로월드를 출력합니다. lcd. print("Hello. World"); //백라이트를 켜줍니다. lcd. backlight(); } void loop() { } 13

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h>

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> NS_Rainbow ns_stick = NS_Rainbow(8, 2); Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); void setup() { lcd. begin(); lcd. print("Hello. World"); lcd. backlight(); } void loop() { } lcd에 출력을 위한 기본적인 소스입니다. 좌측 소스를 업로드하여 lcd를 관찰하여 봅니다. 14

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h>

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> NS_Rainbow ns_stick = NS_Rainbow(8, 2); Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); void setup() { lcd. begin(); lcd. print("Hello. World"); lcd. backlight(); } void loop() { } lcd에 출력을 위한 기본적인 소스입니다. 좌측 소스를 업로드하여 lcd를 관찰하여 봅니다. 15

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h>

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); void setup() { lcd. begin(); lcd. backlight(); } void loop() { delay(1000); lcd. clear(); lcd. backlight(); lcd. print("on"); delay(1000); lcd. clear(); lcd. no. Backlight(); lcd. print("off"); } lcd의 백라이트를 점멸하는 소스입니다. loop()에서 lcd를 사용할 때 lcd. clear(); 를 사용하지 않을 시 loop반복에 의해 문자가 계속 누적됩니다. 16

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h>

LCD 모듈 이해하기 LCD 모듈 #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); void setup() { lcd. begin(); lcd. backlight(); } void loop() { delay(1000); lcd. clear(); lcd. backlight(); lcd. print("on"); delay(1000); lcd. clear(); lcd. no. Backlight(); lcd. print("off"); } lcd의 백라이트를 점멸하는 소스입니다. loop()에서 lcd를 사용할 때 lcd. clear(); 를 사용하지 않을 시 loop반복에 의해 문자가 계속 누적됩니다. 17

LCD 모듈 이해하기 거리 감지기 실시간으로 lcd모듈에 psd 센서값을 불러오도록 합니다. #include <Wire. h>

LCD 모듈 이해하기 거리 감지기 실시간으로 lcd모듈에 psd 센서값을 불러오도록 합니다. #include <Wire. h> #include <Liquid. Crystal_I 2 C. h> Liquid. Crystal_I 2 C lcd(0 x 27, 16, 2); void setup() { lcd. begin(); lcd. backlight(); } 기본 세팅값을 우선 입력합니다. 18

응용 작품 만들기 실습 • 코드 예시 #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); float timer=0; int first_sp = 0; int last_sp = 0; float sp = 0; void setup() { lcd. begin(); lcd. backlight(); } void loop() { int a 0 = analog. Read(0); lcd. clear(); lcd. print(a 0); if(300<a 0 && 500>a 0) { 24