에듀이노-코딩교육 전문 쇼핑몰 에듀이노-코딩교육 전문 쇼핑몰

학교, 공공기관이라면 후불결제하세요!

 
현재 위치
  1. 게시판
  2. 상품후기

상품후기

상품 게시판 상세
제목 lcd모듈이 동작하지 않아요
작성자 조**** (ip:)
  • 작성일 2018-09-09
  • 추천 추천하기
  • 조회수 523

예제소스를 그대로 복사해서 붙여넣기 했는데도

백라이트는 와 전원 램프는 켜지는데 글자도 표시되지 않고 키를 눌러도 되지 아무것도 나타나지 않습니다.

왜 이런 현상이 생기는 걸까요?

참고로 보드는 우노보드 + LCD keypad shield를 올렸습니다.

이럴리가 없는데..


참고로 소스도 올리겠습니다.

#include <LiquidCrystal.h>

 

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);           // select the pins used on the LCD panel

 

// define some values used by the panel and buttons

int lcd_key     = 0;

int adc_key_in  = 0;

 

#define btnRIGHT  0

#define btnUP     1

#define btnDOWN   2

#define btnLEFT   3

#define btnSELECT 4

#define btnNONE   5

 

int read_LCD_buttons(){               // read the buttons

    adc_key_in = analogRead(0);       // read the value from the sensor

 

    // my buttons when read are centered at these valies: 0, 144, 329, 504, 741

    // we add approx 50 to those values and check to see if we are close

   

    if (adc_key_in > 1000) return btnNONE;

 

// V1.1

 

// V1.0

 

     if (adc_key_in < 50)   return btnRIGHT;  

     if (adc_key_in < 195)  return btnUP;

     if (adc_key_in < 380)  return btnDOWN;

     if (adc_key_in < 555)  return btnLEFT;

     if (adc_key_in < 790)  return btnSELECT;   

   

 

    return btnNONE;                // when all others fail, return this.

}

 

void setup(){

   lcd.begin(16, 2);               // start the library

   lcd.setCursor(0,0);             // set the LCD cursor   position

   lcd.print("Push the buttons");  // print a simple message on the LCD

}

 

void loop(){

   lcd.setCursor(9,1);             // move cursor to second line "1" and 9 spaces over

   lcd.print(millis()/1000);       // display seconds elapsed since power-up

 

   lcd.setCursor(0,1);             // move to the begining of the second line

   lcd_key = read_LCD_buttons();   // read the buttons

 

   switch (lcd_key){               // depending on which button was pushed, we perform an action

 

       case btnRIGHT:{             //  push button "RIGHT" and show the word on the screen

            lcd.print("RIGHT ");

            break;

       }

       case btnLEFT:{

             lcd.print("LEFT   "); //  push button "LEFT" and show the word on the screen

             break;

       }   

       case btnUP:{

             lcd.print("UP    ");  //  push button "UP" and show the word on the screen

             break;

       }

       case btnDOWN:{

             lcd.print("DOWN  ");  //  push button "DOWN" and show the word on the screen

             break;

       }

       case btnSELECT:{

             lcd.print("SELECT");  //  push button "SELECT" and show the word on the screen

             break;

       }

       case btnNONE:{

             lcd.print("NONE  ");  //  No action  will show "None" on the screen

             break;

       }

   }

}

평점 5점
첨부파일
비밀번호 삭제하려면 비밀번호를 입력하세요.
댓글 수정

비밀번호 :

수정 취소

/ byte

비밀번호 : 확인 취소

댓글 입력

댓글달기이름 :비밀번호 : 관리자답변보기

확인

/ byte

왼쪽의 문자를 공백없이 입력하세요.(대소문자구분)

회원에게만 댓글 작성 권한이 있습니다.

관련 글 보기

관련글 모음
no item title name date hit
23313 아두이노 LCD + 키패드 쉴드 / Arduino LCD Keypad Shield 구멍과 구멍 사이 간격 HIT파일첨부 전**** 2022-08-18 374
21796 아두이노 LCD + 키패드 쉴드 / Arduino LCD Keypad Shield 일단 배송 무지 빨라서 좋습니다 HIT 임**** 2021-10-16 269
8434 아두이노 LCD + 키패드 쉴드 / Arduino LCD Keypad Shield LCD숼드 좋아요 HIT 유**** 2019-03-25 466
7089 아두이노 LCD + 키패드 쉴드 / Arduino LCD Keypad Shield 핀을 저렇게 많이 잡아먹는데.... HIT 김**** 2018-10-31 638
6321 아두이노 LCD + 키패드 쉴드 / Arduino LCD Keypad Shield lcd모듈이 동작하지 않아요 HIT 조**** 2018-09-09 523
«
»