#include int x; void main(void) { DDRA=0xff; DDRB=0x00; DDRD=0xff; PORTA=0x35; TCCR1A=0xA3; TCCR1B=0x02; TCNT1H=0x00; TCNT1L=0x00; ICR1H=0x00; ICR1L=0x00; OCR1AH=0x01; OCR1AL=0x32; OCR1BH=0x01; OCR1BL=0x32; while (1) { x=PINB; if(x==16) { PORTA=0x31; OCR1AH=0x03; OCR1AL=0x97; OCR1BH=0x00; OCR1BL=0x00; } if(x==4) { PORTA=0x35; OCR1AH=0x02; OCR1AL=0x00; OCR1BH=0x02; OCR1BL=0x00; } if(x==1) { PORTA=0x34; OCR1AH=0x00; OCR1AL=0x00; OCR1BH=0x03; OCR1BL=0x97; } if(x==2) { PORTA=0x35; OCR1AH=0x01; OCR1AL=0x32; OCR1BH=0x02; OCR1BL=0x65; } if(x==8) { PORTA=0x35; OCR1AH=0x02; OCR1AL=0x65; OCR1BH=0x01; OCR1BL=0x32; } } }