In the previous post mentioned about switch (Developer board configuration),that board have four switch and four led
After executing program “buzzer will produce sound while pressing s1″
#include<avr/io.h> //This is the header for AVR Microcontroller.
PORTC=0X00; //PortC initiallization as all bits low.
DDRC=0X08; //PortC data direction declaration as output.
PORTA=0XFF; //PortA initiallization as all bits high (Pull-up Mode).
DDRA=0X00; //PortA data direction declaration as input.
while(1) //This is for the the infinity loop.
if((PINA & 0x10)==0x00) //checking for switch press at s1.
PORTC=0x08; //BZ ON
PORTC=0x00; //BZ OFF