Ch3_6. TextLCD에 문자 출력하기

학습 내용

TextLCD에 "Hello World!"문자 출력하는 제어를 학습하게됩니다.

배선도 & 회로도

700

/media/uploads/jnesystech/chap3_6_bb.png

배선 사진

/media/uploads/jnesystech/_scaled_textlcdphoto1.jpg

TextLCD pinsmbed pins
GND0V
VCC3.3V
VO0V, via 1k resistor
RSp15
RW0V
Ep16
D0not connected
D1not connected
D2not connected
D3not connected
D4p17
D5p18
D6p19
D7p20

Flow Chart

/media/uploads/jnesystech/ch3_6.png

코딩

// Hello World! for the TextLCD

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(p21, p22, p25, p26, p27, p28); // rs, e, d4-d7

int main() {
    lcd.printf("Hello World!\n");
}

라이브러리

Import library

Public Types

enum LCDType { LCD16x2 , LCD16x2B , LCD20x2 , LCD20x4 }

LCD panel format.

More...

Public Member Functions

TextLCD (PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, LCDType type=LCD16x2)
Create a TextLCD interface.
int putc (int c)
Write a character to the LCD.
int printf (const char *format,...)
Write a formated string to the LCD.
void locate (int column, int row)
Locate to a screen column and row.
void cls ()
Clear the screen and locate to 0,0.

BusOut API

DigitalIn API

학습 참고


Please log in to post comments.