Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sbit LCD_RS at RA4_bit;
- sbit LCD_EN at RA5_bit;
- sbit LCD_D4 at RA0_bit;
- sbit LCD_D5 at RA1_bit;
- sbit LCD_D6 at RA2_bit;
- sbit LCD_D7 at RA3_bit;
- sbit LCD_RS_Direction at TRISA4_bit;
- sbit LCD_EN_Direction at TRISA5_bit;
- sbit LCD_D4_Direction at TRISA0_bit;
- sbit LCD_D5_Direction at TRISA1_bit;
- sbit LCD_D6_Direction at TRISA2_bit;
- sbit LCD_D7_Direction at TRISA3_bit;
- char *tekst1;
- char *tekst2;
- int i;
- unsigned cnt;
- void interrupt() {
- if(TMR0IF_bit == 1){
- TMR0IF_bit = 0;
- TMR0 = 241;
- cnt++;}
- }
- void main(){
- ANSEL = 0;
- ANSELH = 0;
- TRISB.B0 = 0xff;
- TRISA = 0x00;
- OPTION_REG = 0b10000110;
- INTCON = 0xA0;
- TMR0 = 248;
- tekst1 = "Angel";
- tekst2 = "Latkoski";
- //cnt = 29 za 15ms; 248
- //cnt = 39 za 20ms;
- //
- Lcd_Init();
- while(1){
- if(PORTB.B0 == 1){
- Lcd_Cmd(_LCD_CLEAR);
- Lcd_Cmd(_LCD_CURSOR_OFF);
- if(cnt < 29){
- Lcd_Out(1, 8-strlen(tekst1)/2, tekst1);
- }
- else if(cnt >= 29 && cnt < 39){
- Lcd_Out(2, 8-strlen(tekst2)/2, tekst2);
- }
- else if(cnt >= 39)
- cnt = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement