Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define F_CPU 1000000UL
- #include
- #include
- //#include
- void init_timer0()
- {
- TCCR0|=(1<<WGM01)|(1<<WGM00)|(1<<COM01)|(1<<CS01); //PB3
- DDRB|=(1<<PB3);
- }
- void init_timer1()
- { TCCR1A = (1 << COM1B1) | (1 << WGM10) ;
- TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS11) ;
- }
- void init_timer2()
- {
- TCCR2|=(1<<WGM20)|(1<<WGM21)|(1<<COM21)|(1<<CS21); //PD4
- DDRD|=(1<<PD7);
- }
- int i=0x80;
- void main()
- {
- //DDRD=0XFF;
- //DDRA=0xF0;
- //PORTA=0xFF;//pull up resistance//0b11111111
- while(1)
- {
- DDRB=0xFF;
- init_timer0();
- init_timer1();
- init_timer2();
- OCR0=255;
- _delay_ms(1);
- OCR1A=0;
- OCR1B=255;
- _delay_ms(1);
- OCR2=255;
- _delay_ms(1);
- //keypad_read();
- //lcd_init();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement