Está en la página 1de 2

DEFINE OSC 4 DEFINE LCD_DREG PORTB DEFINE LCD_DBIT 4 DEFINE LCD_RSREG PORTB DEFINE LCD_RSBIT 1 DEFINE LCD_EREG PORTB

DEFINE LCD_EBIT 2

DEFINE ADC_BITS 8 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 50

VALOR1 VAR WORD VALOR2 VAR WORD TEMPERATURA1 VAR BYTE TEMPERATURA2 VAR BYTE RED VAR PORTC.0 GREEN VAR PORTC.1 YELLOW VAR PORTC.2 TRISA = 1 TRISB = 0 TRISC = 0 PAUSE 100

ADCON1 = %1101

INICIO: GREEN = 0

RED = 0 YELLOW = 0 LCDOUT $FE,1 ADCIN 0,VALOR1 TEMPERATURA1 = VALOR1 adcin 1,VALOR2 TEMPERATURA2 = VALOR2

LCDOUT $FE,2,"TEMP1 =", DEC TEMPERATURA1,$DF,"C", $FE,$C0 LCDOUT "TEMP2 =",DEC TEMPERATURA2,$DF,"C" IF TEMPERATURA1 < TEMPERATURA2 THEN GREEN = 1 ENDIF

IF TEMPERATURA1 > TEMPERATURA2 then YELLOW = 1 ENDIF

IF TEMPERATURA1 == TEMPERATURA2 THEN RED = 1 ENDIF

PAUSE 100 GOTO INICIO

END