Termometro en MikroC-Codigo
Termometro en MikroC-Codigo
Termometro en MikroC-Codigo
Termometro en MikroC-Codigo.txt unsigned char ch; unsigned int adc_rd; char *text,*text1; long tlong; int i,j; void main() { INTCON = 0; Lcd_Config(&PORTB, 4, 5, 6, 3, 2, 1, 0); LCD_Cmd(LCD_CURSOR_OFF); LCD_Cmd(LCD_CLEAR); for(i=0;i<5;i++){ LCD_Cmd(LCD_CLEAR); text = "INGENIERIA"; LCD_Out(1,i,text); Delay_ms(100); } text1 = "ELECTRONICA"; LCD_Out(2,3,text1); ADCON1 = 0x82; TRISA = 0xFF; Delay_ms(1000); LCD_Cmd(LCD_CLEAR); text = "Temperatura:"; for(j=16;j>0;j--){ LCD_Cmd(LCD_CLEAR); LCD_Out(1,j,text); Delay_ms(100); } while (1) { adc_rd = ADC_read(2); tlong = (long)adc_rd * 5000; tlong = tlong / 1023 - 40; ch = tlong / 1000; if(ch==0) LCD_Chr(2,6,' '); else LCD_Chr(2,6,48+ch); ch = (tlong / 100) % 10;
LCD_Chr_CP(48+ch); ch = (tlong / 10) % 10; LCD_Chr_CP(48+ch); LCD_Chr_CP('.'); ch = tlong % 10; LCD_Chr_CP(48+ch); LCD_Chr_CP('C'); Delay_ms(200); } } PD:Apoyanos a mantener el blog haciendo 2 clicks sobre los Anuncios Google publicados.Gracias
Pgina 1