BASIC4MCU | 질문게시판 | 답변 : 헤더파일 디버깅하는데 자꾸 에러가 나네요..
페이지 정보
작성자 남민기 작성일2018-12-12 23:43 조회7,593회 댓글1건본문
void LCD_command(unsigned char command)
{
PORTD = 0x00;
PORTD = 0x01;
PORTB = command;
PORTD = 0x00;
_delay_us(50);
PORTD = 0x00;
}
void LCD_data(unsigned char data)
{
PORTD = 0x02;
PORTD = 0x03;
PORTB = data;
PORTD = 0x02;
_delay_us(50);
PORTD = 0x00;
}
void LCD_clear()
{
LCD_command(0x01);
_delay_ms(2);
}
void LCD_initialize(void)
{
PORTD = 0x03;
PORTD = 0x02;
_delay_ms(2);
LCD_command(0x38);
LCD_command(0x0c);
LCD_command(0x06);
LCD_clear();
}
void LCD_string(unsigned char command, char *string)
{
LCD_command(command);
while(*string != '\0')
{
LCD_data(*string);
string++;
}
}
void char_position(char x, char y)
{
unsigned char position;
if(y>1) y=1;
if(x>15) x=15;
position = y ? x+0xc0 : x+0x80;
LCD_command(position);
}
void Port_init(void)
{
DDRB = 0xff;
PORTB = 0x00;
DDRD = 0xff;
PORTD = 0x00;
}
원문 + 댓글 + 답변
이 세개 파일 입니다.
원문key.h
댓글main.c
답변lcd.h
댓글 1
조회수 7,593master님의 댓글
master 작성일
어디서 어디까지가 무슨 파일인지 모르겠습니다.
압축해서 첨부파일에 올려보세요