#include <avr/io.h>
#include <util/delay.h>
#include <stdio.h>
#include "lcd.h"
int main(void)
{
int i;
init_LCD(); //
instruction_out(0x80);
Lcd_out('h');
Lcd_out('e');
Lcd_out('l');
Lcd_out('l');
Lcd_out('o');
Lcd_out('!');
Lcd_out('!');
Lcd_string_out(0xC0, "Sensor ! ! ");
for(i=0;i<20;i++) // 1.제가 모듈로 돌려보니까 실제 lcd에서 hello!! / HBE_sensor_mult 이거만 계속 뜨더라구요 이게 반복중이라 그런건가요?
_delay_ms(100); // 2.여기서 delay를 왜 for문 밑에 넣었나요? 위에 hello!! / Sensor ! ! 이문장 끝나고 쉬라고 delay하는거면 for문 위에 와야되는거아니에요?
fdevopen(Lcd_out,0);
instruction_out(0x01);
instruction_out(0x80);
print("hello! "); //
instruction_out(0xC0);
printf("HBE_sensor_mult");
return0; //
}
아 진짜 어디 물어볼데도 없고 힘드네요 ..
100 밀리세컨드(0.1초)를 20번, 총 2초를 기다리다 아래로 넘어가란 소리다.
그러면 for문이 시작하기전에 적어줘야되는거아님?
단단히 착각하고 있구만. for 문은 그 다음문장인 delay 를 20번 돌리는 역할을 하고 있다. 화면에 찍는걸 20번 하고 있는게 아니라는거야. 니가 HBE_sensor_mult 를 본 순간 이미 프로그램은 main 함수를 빠져나가 종료된거다.
avr 이 문제가 아니고 멍청아 C 의 for 문이나 제대로 공부하고 와.
님 친추 같은거 못해요? 카톡 친추못해요?? 머좀물어보고싶은데 ㅠㅠㅠ