100% found this document useful (4 votes)
71 views2 pages

E:/#0-2S2017/#1-TEC - SELDI/SAP-02 - Projeto Forno MCU/SELDI - SAP-02 MCU - FW/Forno - DSET-SAP01 - 137-V1.X/op - Manual.h

This document contains code for a manual operation mode. It defines a function called "manual" that displays instructions on an LCD screen and monitors button input to control a motor and heating element manually. Buttons can start or stop the motor, make it advance or reverse, turn heating on or off. The loop repeats until the start button is pressed to exit manual mode.
Copyright
© © All Rights Reserved
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
100% found this document useful (4 votes)
71 views2 pages

E:/#0-2S2017/#1-TEC - SELDI/SAP-02 - Projeto Forno MCU/SELDI - SAP-02 MCU - FW/Forno - DSET-SAP01 - 137-V1.X/op - Manual.h

This document contains code for a manual operation mode. It defines a function called "manual" that displays instructions on an LCD screen and monitors button input to control a motor and heating element manually. Buttons can start or stop the motor, make it advance or reverse, turn heating on or off. The loop repeats until the start button is pressed to exit manual mode.
Copyright
© © All Rights Reserved
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/ 2

E:/#0-2S2017/#1-TEC_SELDI/SAP-02 - Projeto Forno MCU/SELDI_SAP-02 MCU_FW/Forno_DSET-SAP01_137-V1.X/op_manual.

/*
* File:
* Author:
* Comments:
* Revision history:
*/

#ifndef XC_HEADER_TEMPLATE_H
#defineXC_HEADER_TEMPLATE_H

#include <xc.h> // include processor files - each processor file is guarded.

#endif/* XC_HEADER_TEMPLATE_H */

///////////////////////////OPERAÇÃO MANUAL///////////////////////////////////

void manual (void)


{
LCD_cmd(0x80);
LCD_string(" ");//APAGA primeira LINHA
LCD_cmd(0xC0);
LCD_string(" ");//APAGA SEGUNDA LINHA
do{
LCD_cmd(0x80);
LCD_string("OPERAC. MANUAL ");
c0=1; c1=1; c2=1; c3=1;

//###########MOTOR ON/MOTOR OFF###############


c1=0; //ACIONA COLUNA 1
char _c1=c1;
Delay_ms(t_tecl);
if(!l1&!_c1)
{
avnc=1;rec=0;
LCD_cmd(0xC0);LCD_string("Motor avanca ");
}//se tecla motor on estiver acionada, liga motor
c1=1; //DESLIGA COLUNA 1
_c1=1;

c2=0; //ACIONA COLUNA 2


Delay_ms(t_tecl);

char _c2=c2;
if(!l1&!_c2)
{ avnc=0;rec=0;
LCD_cmd(0xC0);LCD_string("Desliga motor ");
}//se tecla motor off estiver acionada, desliga
c2=1;
_c2=1;

1.1 of 2 2017.04.03 20:37:48


E:/#0-2S2017/#1-TEC_SELDI/SAP-02 - Projeto Forno MCU/SELDI_SAP-02 MCU_FW/Forno_DSET-SAP01_137-V1.X/op_manual.h
//###########AVANÇO/RECUO###############
c2=0; //ACIONA COLUNA 2
char _c2=c2;
Delay_ms(t_tecl);
if(!l3&!_c2)
{
avnc=1;rec=0;
LCD_cmd(0xC0);LCD_string("Motor avanca ");
}//se tecla motor on estiver acionada, liga motor
c2=1;
_c2=1;
c1=0;
Delay_ms(t_tecl);
char _c1=c1;
if(!l3&!_c1)
{ avnc=0;rec=1;
LCD_cmd(0xC0);LCD_string("Recua motor ");
}//se tecla motor off estiver acionada, desliga
c1=1;
_c1=1;

//###########AQUECIMENTO ON/AQUECIMENTO OFF###############


c1=0; //ACIONA COLUNA 2
char _c1=c1;
Delay_ms(t_tecl);
if(!l2&!_c1)
{
reaq=1; vent=1;
LCD_cmd(0xC0);LCD_string("Resist. ligada ");
}//se tecla motor on estiver acionada, liga motor
c1=1;
_c1=1;
c2=0;
Delay_ms(t_tecl);
char _c2=c2;

if(!l2&!_c2)
{ reaq=0; vent=0;
LCD_cmd(0xC0);LCD_string("Resist desligada");
}//se tecla motor off estiver acionada, desliga
c2=1;
_c2=1;

}while(start); //ao pressionar start, sai da operação manual e inicia autom.


}

2.1 of 2 2017.04.03 20:37:48

You might also like