Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // LCD module connections
- sbit LCD_RS at RE1_bit;
- sbit LCD_EN at RE2_bit;
- sbit LCD_D4 at RD4_bit;
- sbit LCD_D5 at RD5_bit;
- sbit LCD_D6 at RD6_bit;
- sbit LCD_D7 at RD7_bit;
- sbit LCD_RS_Direction at TRISE1_bit;
- sbit LCD_EN_Direction at TRISE2_bit;
- sbit LCD_D4_Direction at TRISD4_bit;
- sbit LCD_D5_Direction at TRISD5_bit;
- sbit LCD_D6_Direction at TRISD6_bit;
- sbit LCD_D7_Direction at TRISD7_bit;
- // End LCD module connections
- char txt[6];
- int ad;
- void main(){
- ADCON1 |=0x09;
- Lcd_Init(); // Initialize LCD
- Lcd_Cmd(_LCD_CLEAR); // Clear display
- Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
- lcd_Out(1,1,"LLLLLL");
- while(1){
- ad=ADC_Read(0);
- WordToStr(ad,txt);
- Lcd_Out(2,1,txt); // Write text in first row
- Delay_ms(200);
- ad=ADC_Read(3);
- WordToStr(ad,txt);
- Lcd_Out(2,9,txt); // Write text in first row
- Delay_ms(200);
- ad=ADC_Read(4);
- WordToStr(ad,txt);
- Lcd_Out(1,1,txt); // Write text in first row
- Delay_ms(200);
- ad=ADC_Read(5);
- WordToStr(ad,txt);
- Lcd_Out(1,9,txt); // Write text in first row
- Delay_ms(200);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement