From 09c76867a43b4abf5669a33436108737b5f5a5be Mon Sep 17 00:00:00 2001 From: Thammi Date: Mon, 26 Aug 2013 20:40:02 +0200 Subject: [PATCH] Less awkward ir signal generation --- fw_test/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fw_test/main.c b/fw_test/main.c index d579f92..2e61742 100644 --- a/fw_test/main.c +++ b/fw_test/main.c @@ -11,7 +11,6 @@ #define not_follow(from_port, from_pin, to_port, to_pin) { if(from_port & (1 << from_pin)) to_port |= 1 << to_pin; else to_port &= ~(1 << to_pin); } ISR(TIMER0_COMPA_vect) { - TCNT0 = 0; PORTD ^= 1 << 2; } @@ -41,8 +40,7 @@ int main(void) { // initialize timer TIMSK0 |= (1 << OCIE0A); - // this should be a 105 or something ... measure multiple bugs with a real measurement device - OCR0A = 85; + OCR0A = 105; // no prescaler @@ -86,6 +84,7 @@ int main(void) { // send IR if(!(PIND & (1 << 6))) { + TCCR0A = (1 << WGM01); TCCR0B = (1 << CS00); } else { TCCR0B = 0;