Advertisement
RuiViana

main.c

May 27th, 2016
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1.  
  2. //LCD Module Connections  
  3. #define LCD_RS_PIN      PIN_B1                                  
  4. #define LCD_RW_PIN      PIN_B2
  5. #define LCD_ENABLE_PIN  PIN_B3
  6. #define LCD_DATA4       PIN_B4                                    
  7. #define LCD_DATA5       PIN_B5                                    
  8. #define LCD_DATA6       PIN_B6                          
  9. #define LCD_DATA7       PIN_B7
  10. //End LCD Module Connections
  11.  
  12. #include <main.h>
  13. #include <lcd.c>
  14.  
  15. #use delay (clock=4000000)
  16.  
  17. void main()
  18. {
  19.    int i=0;
  20.    
  21.    lcd_init();
  22.    Delay_ms(100);
  23.  
  24.    while(TRUE)
  25.    {
  26.      lcd_putc('\f'); //Clear Display
  27.      lcd_putc("Hello World");
  28.      Delay_ms(2000);
  29.      lcd_putc('\f'); //Clear Display
  30.      lcd_putc("Welcome To");
  31.      lcd_gotoxy(1,2);
  32.      lcd_putc("LCD Library");
  33.      Delay_ms(2000);
  34.      lcd_putc('\f');
  35.      printf(lcd_putc,"Count = %d", i);
  36.      Delay_ms(2000);
  37.      i++;
  38.    }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement