#include <mega16.h>
#include <stdio.h>
#include <delay.h>
#include <stdlib.h>
/*...............*/
void main(void)
{
// Declare your local variables here
char str[10],lcd[10];
float tf;
/* initialization*/
while (1)
{
// Place your code here
delay_ms(1000);
tf=read_adc(0); //lm35 is connected to PORTA.0(pin 40)
tf=(tf*500/1023);
ftoa(tf,1,str);
sprintf(lcd,"Temp %2s \xdfC",str);
lcd_clear();
lcd_gotoxy(0,0);
puts(lcd);
};
}
copyright:امیر رهآافروز
#include <stdio.h>
#include <delay.h>
#include <stdlib.h>
/*...............*/
void main(void)
{
// Declare your local variables here
char str[10],lcd[10];
float tf;
/* initialization*/
while (1)
{
// Place your code here
delay_ms(1000);
tf=read_adc(0); //lm35 is connected to PORTA.0(pin 40)
tf=(tf*500/1023);
ftoa(tf,1,str);
sprintf(lcd,"Temp %2s \xdfC",str);
lcd_clear();
lcd_gotoxy(0,0);
puts(lcd);
};
}
copyright:امیر رهآافروز
دیدگاه