0% found this document useful (0 votes)
221 views1 page

Programa en Picbasic Compilador Microcode Studio PDF

This document contains a PICBasic program for controlling a boiler system. The program uses an LCD display and ADC to read temperatures, and controls relays to heat or cool based on high and low temperature thresholds that can be programmed. It stores the temperature thresholds in EEPROM.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
221 views1 page

Programa en Picbasic Compilador Microcode Studio PDF

This document contains a PICBasic program for controlling a boiler system. The program uses an LCD display and ADC to read temperatures, and controls relays to heat or cool based on high and low temperature thresholds that can be programmed. It stores the temperature thresholds in EEPROM.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PROGRAMA EN PICBASIC COMPILADOR MICROCODE STUDIO. '**************************************************************** '* Name : SISTEMACALDERAS.

BAS * '* Author : MIGUEL VALDEZ * '* Notice : Copyright (c) 2012 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 06/05/2012 * '* Version : 1.0 * '* Notes : * '* : * '******************************* ******************************* ** DEFINE LCD_DREG PORTB DEFINE LCD_DBIT 0 DEFINE LCD_RSREG PORTE DEFINE LCD_RSBIT 0 DEFINE LCD_EREG PORTE DEFINE LCD_EBIT 2 DEFINE ADC_BITS 8 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 50 TRISE=%0 TRISB=%0 TRISA=%1 ADCON1=%00001110 dator var byte dato VAR BYTE tempbaj VAR byte tempalt VAR BYTE x Var byte releF var portD.2 releC var portD.3 led var portD.4 enter var portD.5 bsubir var portD.6 bbajar var portD.7 EEPROM 0,[31,35] inicio for x= 1 to 3 high led pause 200 low led PAUSE 200 NEXT READ 0,tempbaj read 1,tempalt sensar: ADCIN 0,dato lcdout $fe,1,"T.mi T.actu T.ma" dato=dato/2 lcdout $FE,$C6,DEC dato,"oC" lcdout $FE,$c0,DEC tempbaj,"oC" lcdout $FE,$cc,DEC tempalt,"oC" for x= 1 to 50 if enter= 0 THEn grabar1a pause 10 next if dato < tempbaj then calentar if dato > tempalt Then enfriar LOW releC: LOW releF goto sensar calentar: high releC: LOW releF goto sensar enfriar: high relef: low releC goto sensar grabar1a: gosub soltar grabar1: lcdout $fe,1, "Programar temp." lcdout $fe,$c0,"baja=",dec tempbaj, "oC" PAUSE 100 IF bbajar=0 then restar1 if bsubir=0 then sumar1 if enter=0 then grabarA goto grabar1 restar1: gosub soltar if tempbaj<1 then grabar1 tempbaj=tempbaj - 1 goto grabar1 sumar1: gosub soltar IF TEMPBAJ>40 THEN GRABAR1 TEMPBAJ=TEMPBAJ + 1 GOTO grabar1 grabarA: gosub soltar write 0, tempbaj grabar2: lcdout $fe,1, "programar temp." lcdout $fe,$c0, "alta=", dec tempalt,"oC" pause 100 if bbajar=0 then restar2 if bsubir=0 then sumar2 if enter=0 then grabarB goto grabar2 restar2: gosub soltar if tempalt<5 then grabar2 tempalt=tempalt-1 goto grabar2 sumar2: gosub soltar if tempalt>50 then grabar2 tempalt=tempalt+1 goto grabar2 grabarB: gosub soltar write 1,tempalt goto inicio

soltar: High led pause 150 low led soltar2 if bbajar=0 then soltar2 if bsubir=0 then soltar2 if enter=0 then soltar2 pause 100 return end

You might also like