Project

General

Profile

Revision 859

carrier frequency works but not high/low

View differences:

homing.c
42 42
#include "serial.h"
43 43

  
44 44
volatile int state = 0;
45
volatile int orbstate = 0;
46 45

  
47 46
void IR_init(void){
48 47
  
49
  
48
  usb_puts("hi\n");
50 49
  DDRA |= _BV(DDA0)|_BV(DDA1);
51 50
  DDRB |= _BV(DDB3);
51
  DDRC |= _BV(DDC0)|_BV(DDC1);
52 52
  
53 53
  sei();
54 54

  
......
61 61
  TCCR1A |= _BV(COM1B1)|_BV(COM1B0)|_BV(WGM11);	
62 62
  TCCR1B |= _BV(WGM13)|_BV(WGM12)|_BV(CS10);
63 63
  ICR1 = 0x9C40;
64
  orb_init();
65 64
  
66 65
  
67 66
}
......
69 68
ISR(TIMER1_OVF_vect){
70 69
  state = (state+1)%4;
71 70
  PORTA |= state;
72
  set_orb(255*orbstate, 255*orbstate, 255*orbstate);
73
  orbstate = (orbstate+1)%2;
74
  
71
  PORTC &= state + 0xFC;
75 72

  
76 73
}

Also available in: Unified diff