Vlad.
Full Member level 3
- Joined
- Jun 4, 2012
- Messages
- 179
- Helped
- 3
- Reputation
- 6
- Reaction score
- 4
- Trophy points
- 1,298
- Location
- Bucharest/Romania
- Activity points
- 2,568
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
I want to see to LCD the degress Celsius and Fahrenheit. Somebody have time for this?
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?