14.11.2012 Views

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

104 Appendix B. Documentation <strong>of</strong> <strong>the</strong> programming<br />

}<br />

/*Enable TIM0 Output Compare1 interrupt*/<br />

TIM_ITConfig(TIM0, TIM_IT_TO | TIM_IT_OC1 | TIM_IT_OC2,<br />

ENABLE);<br />

/*Enable TIM1 Output Compare1 interrupt*/<br />

TIM_ITConfig(TIM1, TIM_IT_TO | TIM_IT_OC1 | TIM_IT_OC2,<br />

ENABLE);<br />

/*Enable TIM3 Output Compare1 interrupt*/<br />

TIM_ITConfig(TIM3, TIM_IT_TO | TIM_IT_OC1 | TIM_IT_OC2,<br />

ENABLE);<br />

VIC_Config(TIM0_ITLine, VIC_IRQ, 9);<br />

VIC_ITCmd(TIM0_ITLine, ENABLE);<br />

VIC_Config(TIM1_ITLine, VIC_IRQ, 10);<br />

VIC_ITCmd(TIM1_ITLine, ENABLE);<br />

VIC_Config(TIM3_ITLine, VIC_IRQ, 11);<br />

VIC_ITCmd(TIM3_ITLine, ENABLE);<br />

/*Start*/<br />

TIM_CounterCmd(TIM0, TIM_START);<br />

TIM_CounterCmd(TIM1, TIM_START);<br />

TIM_CounterCmd(TIM3, TIM_START);<br />

u8 i;<br />

s16 speed[3];<br />

for (i = 0; i < NUM_MOTORS; i++) {<br />

speed[i] = 0;<br />

}<br />

Set_Speed(speed, CLOSE);<br />

void Position_Camera(u8 position) {<br />

servo_flag = 0;<br />

servo_position = position;<br />

}<br />

void Init_Bumpers() {<br />

GPIO_InitTypeDef GPIO_InitStructure;<br />

GPIO_StructInit(&GPIO_InitStructure);<br />

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;<br />

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3;<br />

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;<br />

GPIO_Init(GPIO5, &GPIO_InitStructure);<br />

GPIO_StructInit(&GPIO_InitStructure);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!