Project

General

Profile

Revision 73d308b3

ID73d308b3a8b6c6e8e399dc387bacf4be65f8681e
Parent 32c4f513
Child c481adc8

Added by Thomas Mullins almost 11 years ago

Fixed orbs

Blue and green are switched on the schematic, so I had to switch them in
the code.

View differences:

scout_avr/src/orb.cpp
11 11
  DDRE |= _BV(PE3) | _BV(PE4) | _BV(PE5);
12 12

  
13 13
  orb_set0(0, 0, 0);
14
  orb_set1(0, 0, 0);
14
  //orb_set1(0, 0, 0);
15
  orb_set1(0, 255, 255);
15 16
  	
16 17
	/* timer 2 */
17
  TCCR2A |= _BV(COM2A1) | _BV(WGM20);
18
  TCCR2A |= _BV(COM2A1) | _BV(COM2A0) | _BV(WGM20);
18 19
	TCCR2B |= _BV(CS21);
19 20

  
20 21
	/* timer 1 */
21
	TCCR1A |= _BV(COM1A1) | _BV(COM1B1) | _BV(WGM10);
22
	TCCR1A |= _BV(COM1A1) | _BV(COM1A0) |  _BV(COM1B1) | _BV(COM1B0) |_BV(WGM10);
22 23
	TCCR1B |= _BV(CS11);
23 24

  
24 25
	/* timer 3 */
25
	TCCR3A |= _BV(COM3A1) | _BV(COM3B1) | _BV(COM3C1) | _BV(WGM30);
26
  TCCR3A |= _BV(COM3A1) | _BV(COM3A0) | _BV(COM3B1) | _BV(COM3B0) | _BV(COM3C1)
27
    | _BV(COM3C0) | _BV(WGM30);
26 28
	TCCR3B |= _BV(CS31);
27 29
}
28 30

  
29 31
void orb_set0(unsigned char r, unsigned char g, unsigned char b) {
30 32
	OCR1B = r;
31
	OCR1A = g;
32
	OCR2A = b;
33
	OCR2A = g;
34
	OCR1A = b;
33 35
}
34 36

  
35 37
void orb_set1(unsigned char r, unsigned char g, unsigned char b) {
36 38
	OCR3B = r;
37
	OCR3A = g;
38
	OCR3C = b;
39
	OCR3C = g;
40
	OCR3A = b;
39 41
}

Also available in: Unified diff