Nguyên văn bởi minhpic
Code:
const rom char tuila = "mot nguoi nao do";
À nếu sai thì bạn thông cảm nhé, vì có khi tớ lộn với C18
const rom char tuila = "mot nguoi nao do";
BYTE CONST TABLE [10]= {9,8,7,6,5,4,3,2,1,0};
x = TABLE [i];
x = TABLE [5];
ptr = &TABLE [i];
BYTE CONST STRING [10] = "Hello";
#define use_portb_lcd TRUE
#if defined(__PCM__)
#include <16F877.H>
#device *=16
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#elif defined(__PCH__)
#include <18F452.H>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#endif
#include <lcd.c>
// CONSTANTS
byte const str_table [2][10] = {"Hello!", "Xin chao!"};
void main() {
lcd_init();
delay_ms(6);
//Print first line to LCD
lcd_putc(str_table[0]);
//Move to the beginning of the second line
lcd_gotoxy(1, 2);
//Print second line to LCD
lcd_putc(str_table[1]);
// loop always
while(TRUE);
}
Comment