Advertisement
KgCro

L07Zneki_4

Nov 26th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. /*
  2. #define F_CPU 7372800UL
  3. */
  4. #include <avr/io.h>
  5. #include <avr/interrupt.h>
  6.  
  7. ISR(TIMER1_COMPA_vect){
  8. PORTA ^= _BV(0);
  9. }
  10.  
  11. int main(void){
  12.  
  13. DDRA = _BV(0);
  14. PORTA = _BV(0);
  15.  
  16. TCCR1A = _BV(WGM11) | _BV(WGM10);
  17. TCCR1B = _BV(CS10);
  18. OCR1A = 511;// 1023-> 0x03ff 1023*0.50 -> intenzitet LEDice je 100% na 1023
  19.  
  20. TIMSK = _BV(OCIE1A);
  21. sei();
  22.  
  23. while(1);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement