SINALEIRA IITAMBEM PUDE OBSERVAR QUE PODERIA HAVER UMA SINCRONIA DAS SINALEIRAS UTILIZANDO O CLOK, PELO PROTEUS, COM FLIP-FLOP, PODEMOS LIGAR 5 CLOCK'SALTERNADAMENTE, POIS O MASTER RECEBE A INFORMACAO E JOGA NO SLAVE. DESAFIO 3.1 PANIFICADORA#include <lpc213x.h>#include "c:\Keil\ARM\3_LCD 2X 16\lcd.h"//definindo entradas IODIR1#define chave_liga_D (1<<16)#define sensor_porta (1<<17)#define botao_prog (1<<18)#define sensor_temp (1<<19)//definindo saidas IODIR0#define display_aviso (1<<20)#define display_funcao (1<<21)#define resist_cozim (1<<22)#define interrupcao (1<<23)#define motor_mist (1<<24)int i;/****************************************************************************************************************************************** FUNCAO PORTA ABERTA INTERRUPCAO*******************************************************************************************************************************************/void abre_tampa (void){ IOCLR0 = (display_aviso); IOCLR0 = (display_funcao); IOCLR0 = (resist_cozim); IOCLR0 = (interrupcao); IOCLR0 = (motor_mist); IOCLR1 = (chave_liga_D); IOCLR1 = (botao_prog); IOCLR1 = (sensor_temp); lcd_puts ("Aviso"); lcd_gotoxy (1,0); lcd_puts ("TAMPA ABERTA"); while (IOPIN0 & (interrupcao)); // enquanto tampa aberta nada funciona { IOSET0 = (display_aviso); for (i=0; i <10; i++); IOCLR1 = (chave_liga_D); IOCLR1 = (botao_prog); }} int main (void) { init_lcd (); IODIR0 = 0xffffffff; //informando pinos saidas IODIR1 = 0xfff7ffff; //informando pinos entradas /*************************************************************************************************************************** INICIANDO PROCESSO MISTURA PAO ****************************************************************************************************************************/ while (1) { IOSET1 = (motor_mist); lcd_clr (); lcd_puts ("ACRESCENTAR"); lcd_gotoxy (1,0); lcd_puts ("INGREDIENTES"); lcd_gotoxy (1,0); lcd_puts ("MISTURA MASSA"); lcd_gotoxy (1,0); for (i=0; i < 10; i++); IOCLR1 = (sensor_porta); //desligando sensor porta IOCLR0 = (motor_mist); //desligando sensor mistura //acionando chave liga e sensor temperatura IOSET1 = (chave_liga_D); IOSET0 = (sensor_temp); lcd_clr (); lcd_puts ("COL.PAO FORNO"); lcd_gotoxy (1,0); lcd_puts ("LIGA CHAVE"); lcd_gotoxy (1,0); lcd_puts ("TEMP.150 GRAUS"); lcd_gotoxy (1,0); for (i=0; i < 10; i++); IOCLR1 = (interrupcao); //acionando sensor temp IOSET0 = (sensor_temp); lcd_clr (); lcd_puts ("PAO NO FORNO"); lcd_gotoxy (1,0); lcd_puts ("REGULA TEMP."); lcd_gotoxy (1,0); lcd_puts ("150 GRAUS"); lcd_gotoxy (1,0); for (i=0; i < 10; i++); IOCLR0 = (interrupcao); //acionando botao display funcao 1 IOSET0 = (display_funcao); //acionando funcao 1 IOSET1 = (sensor_temp); //ligando sensor temperatura lcd_clr (); lcd_puts (" FUNCAO 01"); lcd_gotoxy (1,0); lcd_puts ("PAO NO FORNO"); lcd_gotoxy (1,0); lcd_puts ("ASSAR 20 MIN"); lcd_gotoxy (1,0); lcd_puts ("TEMP 150 GRAUS"); lcd_gotoxy (1,0); for (i=0; i < 10; i++); IOCLR0 = (interrupcao); //acionando botao display funcao 2 IOSET0 = (display_funcao); //acionando funcao 1 IOSET1 = (sensor_temp); //ligando sensor temperatura lcd_clr (); lcd_puts (" FUNCAO 02"); lcd_gotoxy (1,0); lcd_puts ("PAO CRU"); lcd_gotoxy (1,0); lcd_puts ("ASSAR 20 MIN"); lcd_gotoxy (1,0); lcd_puts ("TEMP 200GRAUS"); lcd_gotoxy (1,0); for (i=0; i < 10; i++); IOCLR0 = (interrupcao); //ACIONANDO COZIMENTO IOSET1 = (resist_cozim); //ligando resistencia cozimento lcd_clr(); lcd_puts (" ASSANDO"); lcd_gotoxy (1,0); lcd_puts ("PAO AIDA CRU"); lcd_gotoxy (1,0); lcd_puts ("ASSAR 20 MIN"); lcd_gotoxy (1,0); lcd_puts ("TEMP 200 GRAUS"); lcd_gotoxy (1,0); for (i=0; i < 10; i++); IOCLR0 = (interrupcao); //acionando display de aviso IOSET0 = (display_aviso); //acionando display aviso lcd_clr(); lcd_puts ("ACIOANDO AVISO"); lcd_gotoxy (1,0); lcd_puts ("PAO QUASE PRONTO"); lcd_gotoxy (1,0); lcd_puts ("ASSAR MAIS 20MIN"); lcd_gotoxy (1,0); lcd_puts ("TEMP 150 GRAUS"); lcd_gotoxy (1,0); for (i=0;i<10;i++); IOCLR0 = (display_funcao); IOCLR0 = (resist_cozim); IOCLR0 = (resist_cozim); IOCLR1 =(chave_liga_D); //modo economia de energia if (IOPIN0 & (interrupcao)) { lcd_clr(); abre_tampa (); } // desligando forno, abrindo porta, pao pronto IOSET1 = (sensor_porta); //acionando display aviso lcd_clr(); lcd_puts ("PAO PRONTO"); lcd_gotoxy (1,0); lcd_puts ("DESLIGANDO FORNO"); lcd_gotoxy (1,0); lcd_puts ("ABRINDO PORTA"); lcd_puts ("RETIRA PAO"); lcd_gotoxy (1,0); for (i=0; i < 10; i++); IOCLR1 = (sensor_porta); } } DESAFIO 1_2#include <lpc213x.h>#define maximo2 (1<<2)#define minimo3 (1<<3)#define