File code cho thiết bị báo cháy chữ cháy tự động /******************************************************* This program was created by the CodeWizardAVR V3.12 Advanced Automatic Program Generator © Copyright 1998-2014 Pavel Haiduc, HP InfoTech s.r.l http://www.hpinfotech.com Project : MAY BAO CHAY VA CHUA CHAY TU DONG Version : Ho Gia Dinh Date : 29/6/2020 Author : Nhom6 Comments : Thiet bi chua duoc hoan thien cu the, mong thay va cac b gop y de thiet bi co the hoan chinh hon THANK FOR WACHING Chip type : ATmega16A Program type : Application AVR Core Clock frequency: 8.000000 MHz Memory model : Small External RAM size: Data Stack size : 256 *******************************************************/ #include #include #include // Alphanumeric LCD functions #include // Standard Input/Output functions #include //Functions void GPIO_Init(void); void Adc_Init(void); void USART_Init(unsigned long BAUDRATE); unsigned char UDataAvailable(); char UReadData(); void UWriteData(char data); void UWriteString(char *str); void UReadBuffer(void *buff,unsigned int len); void UFlushBuffer(); //Low Level Functions signed char SIM800Cmd(const char *cmd); //Public Interface signed char SIM800Init(); signed char SIM800CheckResponse(const char *check,unsigned char len); void SIM800SendMsg(const char *, const char *); #define Buzzer1 PORTC.4 *response,const char #define Power_Off #define PUMP PORTC.0 PORTC.2 #define Relay_ON #define Relay_OFF #define Buzzer_ON #define Buzzer_OFF // Declare your global variables here #define F_CPU 8000000UL #define BAUD_PRESCALE (((F_CPU / (BAUDRATE * 16UL))) - 1) Define prescale value */ #define RECEIVE_BUFF_SIZE 64 //Error List #define SIM800_OK #define SIM800_INVALID_RESPONSE #define SIM800_FAIL -1 -2 #define SIM800_TIMEOUT -3 // Voltage Reference: AREF pin #define ADC_VREF_TYPE ((0