Ir ao conteúdo
  • Cadastre-se

Pic com ds1307 + sht75 + lcd em C


antoniomorais

Posts recomendados

Ola para todos, sou novo na programação, estou querendo montar um conjunto

para medir: temperatura, umidade, programar a hora para ligação de varias valvulas solenoides para irrigação de minhas orquideas. Eu so fiz aparecer data e hora, sem poder ajusta-los.

Estou tentando fazer simulações no Proteus, mais não obtive sucesso...

Se alguem possuir algum codigo que possa me ajudar será muito bem vindo.

Não estou pedindo tudo pronto, estou muito enteressado em aprender programar em c para ccs...

Grato...

Ate breve...com algum esboço do desenho...

Sr. moderador queira me perdoar a dificuldade no momento...

Link para o comentário
Compartilhar em outros sites

Cara tem esse driver pro SHT75, mas parece que não esta bom, pois na simulação da uma diferença grande...

http://www.ccsinfo.com/forum/viewtopic.php?t=28564

Da uma olhada...

O DS1307, estou desenvolvendo um projeto com ele, usei um teclado matricial para ajustar a data e hora...

Você sabe como varer um teclado matricial?

http://www.arnerobotics.com.br/eletronica/teclado_matricial.htm

Link para o comentário
Compartilhar em outros sites

  • 2 semanas depois...
  • 4 semanas depois...
Ola para todos, sou novo na programação, estou querendo montar um conjunto

para medir: temperatura, umidade, programar a hora para ligação de varias valvulas solenoides para irrigação de minhas orquideas. Eu so fiz aparecer data e hora, sem poder ajusta-los.

Estou tentando fazer simulações no Proteus, mais não obtive sucesso...

Se alguem possuir algum codigo que possa me ajudar será muito bem vindo.

Não estou pedindo tudo pronto, estou muito enteressado em aprender programar em c para ccs...

Grato...

Ate breve...com algum esboço do desenho...

Sr. moderador queira me perdoar a dificuldade no momento...

Ola eu tambem estou moontando um circuito parecido com o seu eu tenho algumas partes do projeto funcionando posso te ajudar e como anda o seu projeto?

Link para o comentário
Compartilhar em outros sites

  • 5 meses depois...

Ola vtrx, fiquei muito feliz com sua atenção, eu ja trabalho com eletronica desde 1980, ainda sou da época das válvulas e os primeiros transistores.

No SENAI, estudei os pic's superficialmente, hoje estou fazendo uma reciclagem e gostaria de contar com sua ajuda no meu projeto.

Desde já agradeço a você e todos que de alguma forma, estão me ajudando.

Até breve, muito obrigado a todos.

Qualquer apostila ou material sera de grande ajuda.

Link para o comentário
Compartilhar em outros sites

antoniomorais

Estou com um projeto semelhante, só que é para aquario.

Primeiro foi a parte do controle de temperatura, e essa já está operacional. Se cair abaixo de 27ºC liga um rele, se subir acima de 29º aciona outro rele. Neste caso a temperatura de equilíbrio é 28ºC.

Agora estou implementando um relógio (DS1307), que irá controlar a iluminação, cujo tempo será de aproximadamente 8h/dia.

Mas estou apanhando no "C".

O controle de temperatura tem vários códigos na net, tambem achei o do relógio. Agora é juntar os dois rs.

No Proteus está implementado assim:

projetof.jpg

Uploaded with ImageShack.us

Vamos indo.

Link para o comentário
Compartilhar em outros sites

  • 2 meses depois...

Vou dar minha contribuiçao.O codigo a seguir eu fiz para ligar e desligar a irrigaçao de uma estufa que tem aqui na chacara,então você pode defenir ate 6 planos de liga e desliga ,e na hora de iniciar ela liga ate chegar a hora de desligar.É claro que se pode inserir facilmente a leitura de temperatura e codificar pra que ligue a irrigaçao ao atingir x temperatura ou algo assim.So lembrando que o relogio nao usa o ds1307,mais é bem preciso ,muito bom mesmo.

include <16f873a.h>
#device adc=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT //Clock <=4Mhz
#FUSES PUT //Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection

#use delay(clock=4000000)

#include <flex_lcd.c>

#define botao_incremento PIN_C2
#define botao_decremento PIN_C3

int8 pl;
int modo_plano;
int q;
int sec;
int min;
int hrs;
int8 modo=0;
int8 planos=1;
int8 hrs_p1, min_p1, hrs_p2, min_p2, hrs_p3, min_p3,hrs_p4, min_p4,hrs_p5, min_p5,hrs_p6, min_p6;
int8 hrs_term_p1,min_term_p1,hrs_term_p2,min_term_p2,hrs_term_p3,min_term_p3,hrs_term_p4,min_term_p4,hrs_term_p5,min_term_p5,hrs_term_p6,min_term_p6;
#int_TIMER1 //Interrupção do Timer1
void temp1s(void) //Funcão. O que deverá ser feiro a cada interrupão.
{
q++;

set_timer1 (3036); //Preload do Timer1
}

#int_ccp2
void trata_ccp_2()
{
modo++;
if (modo > 8)
{
modo = 0;
}
}
void CONFIGURA_planos()
{modo_plano=1;
while (modo == 0)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
planos++;
if(planos>6)
{
planos=0;
}
}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
planos--;
if(planos==255)
{
planos=6;
}
}
q=0;
printf (lcd_putc, "\fPLANOS IRRIGAR\n%01u_(PLANOS)", planos);
delay_ms (100);
}
}
void iniciar_PLANO_1()
{
while (modo == 1)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_p1++;
}
if(hrs_p1>23){
hrs_p1=0;
}


if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_p1--;
}
if(hrs_p1==255){
hrs_p1=23;
}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL1 %02u:%02u", hrs_p1,min_p1);
delay_ms (100);
}

while (modo == 2)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_p1++;
if(min_p1>59){
min_p1=0;}
}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_p1--;
if(min_p1==255){
min_p1=59;}
}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL1 %02u:%02u", hrs_p1,min_p1);
delay_ms (100);
}
}
void iniciar_PLANO_2()
{
while (modo == 1)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_p2++; }
if(hrs_p2>23){hrs_p2=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_p2--; }
if(hrs_p2==255){hrs_p2=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL2 %02u:%02u", hrs_p2,min_p2);
delay_ms (100);
}

while (modo == 2)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_P2++; }
if (min_p2>59){min_p2=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_P2--;}
if(min_p2==255){min_p2=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL2 %02u:%02u", hrs_p2,min_p2);
delay_ms (100);
}
}
void iniciar_PLANO_3()
{
while (modo == 1)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_P3++; }
if (hrs_p3>23){hrs_p3=0;}
if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_P3--;}
if(hrs==255){hrs_p3=23;}
Q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL3 %02u:%02u", hrs_p3,min_p3);
delay_ms (100);
}

while (modo == 2)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_P3++; }
if(min_p3>59){min_p3=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_P3--; }
if(min_p3==255){min_p3=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL3 %02u:%02u", hrs_p3,min_p3);
delay_ms (100);
}
}

void iniciar_PLANO_4()
{
while (modo == 1)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_p4++;}
if(hrs_p4>23){hrs_p4=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_p4--; }
if(hrs_p4==255){hrs_p4=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL4 %02u:%02u", hrs_p4,min_p4);
delay_ms (100);
}

while (modo == 2)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_p4++;}
if(min_p4>59){min_p4=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_p4--;}
if(min_p4==255){min_p4=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL4 %02u:%02u", hrs_p4,min_p4);
delay_ms (100);
}
}

void iniciar_PLANO_5()
{
while (modo == 1)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_p5++;}
if(hrs_p5>23){hrs_p5=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_p5--;}
if(hrs_p5==255){hrs_p5=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL5 %02u:%02u", hrs_p5,min_p5);
delay_ms (100);
}

while (modo == 2)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_p5++;}
if(min_p5>59){min_p5=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_p5--;}
if(min_p5==255){min_p5=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL5 %02u:%02u", hrs_p5,min_p5);
delay_ms (100);
}
}

void iniciar_PLANO_6()
{
while (modo == 1)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_p6++;}
if(hrs_p6>23){hrs_p6=0;}


if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_p6--;}
if(hrs_p6==255){hrs_p6=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL6 %02u:%02u", hrs_p6,min_p6);
delay_ms (100);
}

while (modo == 2)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_p6++;}
if(min_p6>59){min_p6=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_p6--;}
if(min_p6==255){min_p6=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nINICIO PL6 %02u:%02u", hrs_p6,min_p6);
delay_ms (100);
}
}



void terminar_PLANO_1()
{
while (modo == 3)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_term_p1++; }
if(hrs_term_p1>23){hrs_term_p1=0;}
if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_term_p1--;}
if(hrs_term_p1==255){hrs_term_p1=23;}

q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL1 %02u:%02u", hrs_term_p1,min_term_p1);
delay_ms (100);
}

while (modo == 4)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_term_p1++;}
if(min_term_p1>59){min_term_p1=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_term_p1--;}
if(min_term_p1==255){min_term_p1=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL1 %02u:%02u", hrs_term_p1,min_term_p1);
delay_ms (100);
}
}

void terminar_plano_2()
{
while (modo == 3)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_term_p2++; }
if(hrs_term_p2>23){hrs_term_p2=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_term_p2--;}
if(hrs_term_p1==255){hrs_term_p1=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL2 %02u:%02u", hrs_term_p2,min_term_p2);
delay_ms (100);
}

while (modo == 4)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_term_p2++;}
if(min_term_p2>59){min_term_p2=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_term_p2--; }
if(min_term_p2==255){min_term_p2=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL2 %02u:%02u", hrs_term_p2,min_term_p2);
delay_ms (100);
}
}
void terminar_PLANO_3()
{
while (modo == 3)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_term_p3++;}
if(hrs_term_p3>23){hrs_term_p3=0;}
if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_term_p3--; }
if(hrs_term_p1==255){hrs_term_p3=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL3 %02u:%02u", hrs_term_p3,min_term_p3);
delay_ms (100);
}

while (modo == 4)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_term_p3++;}
if(min_term_p3>59){min_term_p3=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_term_p3--;}
if(min_term_p3==255){min_term_p3=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL3 %02u:%02u", hrs_term_p3,min_term_p3);
delay_ms (100);
}
}

void terminar_PLANO_4()
{
while (modo == 3)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_term_p4++;}
if(hrs_term_p4>23){hrs_term_p4=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_term_p4--;}
if(hrs_term_p4==255){hrs_term_p4=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL4 %02u:%02u", hrs_term_p4,min_term_p4);
delay_ms (100);
}

while (modo == 4)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_term_p4++;}
if(min_term_p4>59){min_term_p4=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_term_p4--;}
if(min_term_p4==255){min_term_p4=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL4 %02u:%02u", hrs_term_p4,min_term_p4);
delay_ms (100);
}
}


void terminar_PLANO_5()
{
while (modo == 3)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_term_p5++;}
if(hrs_term_p5>23){hrs_term_p5=0;}
if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_term_p5--;}
if(hrs_term_p5==255){hrs_term_p5=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL5 %02u:%02u", hrs_term_p5,min_term_p5);
delay_ms (100);
}

while (modo == 4)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_term_p5++;}
if(min_term_p5>59){min_term_p5=0;}
if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_term_p5--;}
if(min_term_p1==255){min_term_p5=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL5 %02u:%02u", hrs_term_p5,min_term_p5);
delay_ms (100);
}
}

void terminar_PLANO_6()
{
while (modo == 3)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs_term_p6++; }
if(hrs_term_p6>23){hrs_term_p6=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs_term_p6--;}
if(hrs_term_p1==255){hrs_term_p6=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL6 %02u:%02u", hrs_term_p6,min_term_p6);
delay_ms (100);
}

while (modo == 4)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min_term_p6++;}
if(min_term_p6>59){min_term_p6=0;}
if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min_term_p6--;}
if(min_term_p1==255){min_term_p6=59;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf (lcd_putc, "\nTERM.PL6 %02u:%02u", hrs_term_p6,min_term_p6);
delay_ms (100);
}
}


void AJUSTAR_HORA()
{
while (modo == 5)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
hrs++;}
if(hrs>23){hrs=0;}
if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
hrs--;}
if(hrs==255){hrs=23;}
q=0;
printf (lcd_putc, "\f----SETUP----");
printf(lcd_putc,"\nHORA ATUAL %02u:%02u",hrs,min);
delay_ms (100);
}

while (modo == 6)
{
if (input(BOTAO_INCREMENTO))
{
delay_ms (75);
min++;}
if(min>59){min=0;}

if (input(BOTAO_DECREMENTO))
{
delay_ms (75);
min--;}
if(min==255){min=59;}

q=0;
printf (lcd_putc, "\f----SETUP----");
printf(lcd_putc,"\nHORA ATUAL %02u:%02u",hrs,min);
delay_ms (100);
}

}
void saida()
{
while(modo==7){
printf (lcd_putc, "\fPLS PROGRAMADOS");
printf(lcd_putc,"\nPRESSIONE SET ");
delay_ms(100);
}
}
void principal()
{
while(modo==8)
{


sec=q/2;
if (sec==60)
{
q=0;
sec=0;

min++;
}

if (min>59)
{
min=0;
hrs++;
}

if (hrs>23)
{

hrs=0;
}


switch(planos){
case 1:{
if ((hrs==hrs_p1)&&(min==min_p1)){
output_high(pin_c4);}
if ((hrs==hrs_term_p1)&&(min==min_term_p1)){
output_low(pin_c4);

break;
}
}
case 2:{
if ((hrs==hrs_p1)&&(min==min_p1)){
output_high(pin_c4);}
if ((hrs==hrs_term_p1)&&(min==min_term_p1)){
output_low(pin_c4);}

if ((hrs==hrs_p2)&&(min==min_p2)){
output_high(pin_c4);}
if ((hrs==hrs_term_p2)&&(min==min_term_p2)){
pl=planos-2;
output_low(pin_c4);
break;
}
}
case 3:{
if ((hrs==hrs_p1)&&(min==min_p1)){
output_high(pin_c4);}
if ((hrs==hrs_term_p1)&&(min==min_term_p1)){
output_low(pin_c4);}

if ((hrs==hrs_p2)&&(min==min_p2)){
output_high(pin_c4);}
if ((hrs==hrs_term_p2)&&(min==min_term_p2)){
output_low(pin_c4);}

if ((hrs==hrs_p3)&&(min==min_p3)){
output_high(pin_c4);}
if ((hrs==hrs_term_p3)&&(min==min_term_p3)){
output_low(pin_c4);}
}
case 4:{
if ((hrs==hrs_p1)&&(min==min_p1)){
output_high(pin_c4);}
if ((hrs==hrs_term_p1)&&(min==min_term_p1)){
output_low(pin_c4);}

if ((hrs==hrs_p2)&&(min==min_p2)){
output_high(pin_c4);}
if ((hrs==hrs_term_p2)&&(min==min_term_p2)){
output_low(pin_c4);}

if ((hrs==hrs_p3)&&(min==min_p3)){
output_high(pin_c4);}
if ((hrs==hrs_term_p3)&&(min==min_term_p3)){
output_low(pin_c4);}

if ((hrs==hrs_p4)&&(min==min_p1)){
output_high(pin_c4);}
if ((hrs==hrs_term_p1)&&(min==min_term_p4)){
output_low(pin_c4);}
break;
}
case 5:{
if ((hrs==hrs_p1)&&(min==min_p1)){
output_high(pin_c4);}
if ((hrs==hrs_term_p1)&&(min==min_term_p1)){
output_low(pin_c4);}

if ((hrs==hrs_p2)&&(min==min_p2)){
output_high(pin_c4);}
if ((hrs==hrs_term_p2)&&(min==min_term_p2)){
output_low(pin_c4);}

if ((hrs==hrs_p3)&&(min==min_p3)){
output_high(pin_c4);}
if ((hrs==hrs_term_p3)&&(min==min_term_p3)){
output_low(pin_c4);}

if ((hrs==hrs_p4)&&(min==min_p4)){
output_high(pin_c4);}
if ((hrs==hrs_term_p4)&&(min==min_term_p4)){
output_low(pin_c4);}

if ((hrs==hrs_p5)&&(min==min_p5)){
output_high(pin_c4);}
if ((hrs==hrs_term_p5)&&(min==min_term_p5)){
output_low(pin_c4);}
break;
}
case 6:{
if ((hrs==hrs_p1)&&(min==min_p1)){
output_high(pin_c4);}
if ((hrs==hrs_term_p1)&&(min==min_term_p1)){
output_low(pin_c4);}

if ((hrs==hrs_p2)&&(min==min_p2)){
output_high(pin_c4);}
if ((hrs==hrs_term_p2)&&(min==min_term_p2)){
output_low(pin_c4);}

if ((hrs==hrs_p3)&&(min==min_p3)){
output_high(pin_c4);}
if ((hrs==hrs_term_p3)&&(min==min_term_p3)){
output_low(pin_c4);}

if ((hrs==hrs_p4)&&(min==min_p4)){
output_high(pin_c4);}
if ((hrs==hrs_term_p4)&&(min==min_term_p4)){
output_low(pin_c4);}

if ((hrs==hrs_p5)&&(min==min_p5)){
output_high(pin_c4);}
if ((hrs==hrs_term_p5)&&(min==min_term_p5)){
output_low(pin_c4);}

if ((hrs==hrs_p6)&&(min==min_p6)){
output_high(pin_c4);}
if ((hrs==hrs_term_p6)&&(min==min_term_p6)){
output_low(pin_c4);}
break;
}
}
printf (lcd_putc, "\f--Temporizador--\n%02u:%02u:%02u PL:%01u",hrs, min, sec,pl);
delay_ms(100);
}
}
void main()
{
//setup_adc_ports(AN0); //Configura canal 0 analógico
//setup_adc(ADC_CLOCK_INTERNAL); //De acordo com relógio interno.
setup_timer_1 (T1_INTERNAL | T1_DIV_BY_8);
set_timer1 (3036);
enable_interrupts(INT_TIMER1);
setup_ccp2(CCP_CAPTURE_RE);
enable_interrupts (int_ccp2);
enable_interrupts (global);
lcd_init();


modo=0;
CONFIGURA_PLANOS();
break;
switch(planos)
{
case 1:{
modo=1;
iniciar_plano_1();
modo=3;
terminar_plano_1();
break;
}
case 2:{
modo=1;
iniciar_plano_1();
modo=3;
terminar_plano_1();
modo=1;
iniciar_plano_2();
modo=3;
terminar_plano_2();
break;
}
case 3:{
modo=1;
iniciar_plano_1();
modo=3;
terminar_plano_1();
modo=1;
iniciar_plano_2();
modo=3;
terminar_plano_2();
modo=1;
iniciar_plano_3();
modo=3;
terminar_plano_3();
break;
}
case 4:{
modo=1;
iniciar_plano_1();
modo=3;
terminar_plano_1();
modo=1;
iniciar_plano_2();
modo=3;
terminar_plano_2();
modo=1;
iniciar_plano_3();
modo=3;
terminar_plano_3();
modo=1;
iniciar_plano_4();
modo=3;
terminar_plano_4();
break;
}
case 5:{
modo=1;
iniciar_plano_1();
modo=3;
terminar_plano_1();
modo=1;
iniciar_plano_2();
modo=3;
terminar_plano_2();
modo=1;
iniciar_plano_3();
modo=3;
terminar_plano_3();
modo=1;
iniciar_plano_4();
modo=3;
terminar_plano_4();
modo=1;
iniciar_plano_5();
modo=3;
terminar_plano_5();
break;
}
case 6:{
modo=1;
iniciar_plano_1();
modo=3;
terminar_plano_1();
modo=1;
iniciar_plano_2();
modo=3;
terminar_plano_2();
modo=1;
iniciar_plano_3();
modo=3;
terminar_plano_3();
modo=1;
iniciar_plano_4();
modo=3;
terminar_plano_4();
modo=1;
iniciar_plano_5();
modo=3;
terminar_plano_5();
modo=1;
//iniciar_plano_6();
// modo=3;
// terminar_plano_6();
break;
}
}
modo=5;
ajustar_hora();
modo=7;
saida();
break;
while(true)
{
modo=8;
principal();
break;
}
}

Link para o comentário
Compartilhar em outros sites

  • 5 meses depois...
  • 1 ano depois...

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

 

GRÁTIS: ebook Redes Wi-Fi – 2ª Edição

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!