Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

pic16f876A+LCD2x16+LM35z

Status
Not open for further replies.

Vlad.

Full Member level 3
Joined
Jun 4, 2012
Messages
177
Helped
3
Reputation
6
Reaction score
4
Trophy points
1,298
Location
Bucharest/Romania
Activity points
2,545
Hey can somebpdy help me with this code? i try to make a digital thermometer but i don`t know programing.
This is the code
Code:
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;

unsigned int val;
 unsigned int t;

unsigned char ch;

void main()
{
  //TRISA      = 0xFF;                       // designate PORTA as input
  //INTCON = 0;                              // Disable all interrupts
  //IRP_bit = 1 ;

  Lcd_Init();                        // Initialize LCD
  Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
  Lcd_Cmd(_LCD_CLEAR);               // Clear display
  Delay_ms(100);
  LCD_Out(1,2,"Hello Handsome!");
  LCD_Out(2,2,"VoltAmperMeter");
  Delay_ms(1500);
  Lcd_Cmd(_LCD_CLEAR);               // Clear display
  LCD_Out(1,2," Vlad Mihai");
  LCD_Out(2,2," 1341B EA");
  Delay_ms(1500);
  Lcd_Cmd(_LCD_CLEAR);               // Clear display
  LCD_Out(1,2,"Prof. Gaitan");
  LCD_Out(2,2,"Cristina-MC");
  Delay_ms(1500);
Lcd_Cmd(_LCD_CLEAR);               // Clear display

  while (1)
    {
      for (b ; b < 2; b++) {
       Lcd_Cmd(_LCD_CLEAR);
      }

      // Voltage
      val=ADC_read(0);                // get ADC value for U from channel 1
      delay_ms(30);


      val=ADCRead(0);   //Read Channel 0

      t=round(val*0.48876);//Convert to Degree Celcius

      LCDWriteIntXY(0,1,t,3);//Prit IT!



      Delay_ms(300);                        // Waits 300ms
  }
}
I want to see to LCD the degress Celsius and Fahrenheit. Somebody have time for this?
 

Vlad.

Full Member level 3
Joined
Jun 4, 2012
Messages
177
Helped
3
Reputation
6
Reaction score
4
Trophy points
1,298
Location
Bucharest/Romania
Activity points
2,545
i don`t, i was triyng to combine 2 codes from diffenret sources.... sorry.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top