In: Electrical Engineering
DTMF home automation system using ATMEGA8
i need the circuit and the code for the microcontroller
#include <avr/io.h>
#include <util/delay.h>
#include”lcd.h”
int main()
{
int dtmfInput=0;
DDRC=0b0000000;//DTMF input
DDRB=0xFF;//Load output
lcd_init(LCD_DISP_ON);
lcd_puts(“Home Automation”);
lcd_gotoxy(0,1);
lcd_puts(“hello”);
_delay_ms(5000);
_delay_ms(5000);
while(1)
{
lcd_puts(“hiii”);
dtmfInput=PINC&0b0001111;
lcd_gotoxy(0,1);
if(dtmfInput==1){
PORTB|=(1<<PORTB0);
lcd_puts(“FAN ON”);
}
if(dtmfInput==2){
PORTB&=~(1<<PORTB0);
lcd_puts(“FAN OFF”);
}
if(dtmfInput==3){
PORTB|=(1<<PORTB1);
lcd_puts(“AC ON”);
}
if(dtmfInput==4){
PORTB&=~(1<<PORTB1);
lcd_puts(“AC OFF”);
}
if(dtmfInput==5){
PORTB|=(1<<PORTB2);
lcd_puts(“BULB ON”);
}
if(dtmfInput==6){
PORTB&=~(1<<PORTB2);
lcd_puts(“BULB OFF”);
}
_delay_ms(200);
lcd_clrscr();
}
return 0;
}
pls rate thumbs up. plsssssssss