Ch3_6. TextLCD에 문자 출력하기
학습 내용
TextLCD에 "Hello World!"문자 출력하는 제어를 학습하게됩니다.
배선도 & 회로도

배선 사진

| TextLCD pins | mbed pins |
|---|---|
| GND | 0V |
| VCC | 3.3V |
| VO | 0V, via 1k resistor |
| RS | p15 |
| RW | 0V |
| E | p16 |
| D0 | not connected |
| D1 | not connected |
| D2 | not connected |
| D3 | not connected |
| D4 | p17 |
| D5 | p18 |
| D6 | p19 |
| D7 | p20 |
Flow Chart
코딩
// 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.
|
|
학습 참고
Please log in to post comments.
