#define pin1 6
#define pin2 5
#define pin3 1
int freq=0;
int T=0;
void setup()
{
DDRB= 0x00; //input config
DDRC= 0xFF; //output config
}
void choiceOfFreq()
{
PINB= 0xFF; //taking input
if((PINB & 0x60)==0x00)
freq=50;
if((PINB & 0x60)==0x20)
freq=100;
if((PINB & 0x60)==0x40)
freq=200;
if((PINB & 0x60)==0x60)
freq=250;
T=1000000/freq;
}
void loop()
{
choiceOfFreq();
PORTC |= (1<<pin3);
delay(T/2);
PORTC &= ~(1<<pin3);
delay(T/2);
}