Project

General

Profile

Revision 716

trying to get lbom code to work

View differences:

branches/autonomous_recharging/code/projects/libbayboard/lbom.h
46 46
/** @brief Sets up the LBOM to be used. **/
47 47
void bom_init(char type);
48 48
/** @brief Turns the LBOM on. **/
49
void bom_on(void);
49
void bom_on(char type);
50 50
/** @brief Turns the LBOM off. **/
51 51
void bom_off(void);
52 52
/** @brief Sets which LEDs are in use. **/
branches/autonomous_recharging/code/projects/libbayboard/lbom.c
67 67
void bom_init(char type){
68 68
	//set_leds(ALL_ON);
69 69
	DDRC |= _BV(BOM0)|_BV(BOM1)|_BV(BOM2)|_BV(BOM3);
70
	//DDRD |= _BV(DDD7);			//sets bom carrier to write
70
	PORTC |= 0b11110000;
71
	DDRD |= _BV(DDD7);			//sets bom carrier to write
71 72
	bom_mode = type;
72
	bom_on();
73
	bom_on(type);
73 74
}
74 75
/** @brief Turns the LBOM on. **/
75
void bom_on(void){
76
void bom_on(char type){
76 77
	//start timer 2 if not already started
77
	TCCR2A = _BV(COM2A1)|_BV(WGM21)|_BV(WGM20);
78
	TCCR2A = _BV(COM2A1)|_BV(COM2A0)|_BV(WGM21)|_BV(WGM20);
78 79
	TCCR2B = _BV(CS20);
79 80
	switch(bom_mode){
80 81
	case BOM:
81
		OCR2A = 255;
82
		OCR2A = 1;
82 83
	case BOM1_5:
83
		OCR2A = 255;
84
		OCR2A = 1;
84 85
	case RBOM:
85 86
		OCR2A = 127;
86 87
	default:
87
		OCR2A = 255;
88
		OCR2A = 1;
88 89
	}
89 90
}
90 91
/** @brief Turns the LBOM off. **/

Also available in: Unified diff