-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.c
More file actions
41 lines (31 loc) · 816 Bytes
/
main.c
File metadata and controls
41 lines (31 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Drone_Project_HN.c
*
* Created: 2021-01-31 오후 12:16:04
* Author : phn15
*/
#define F_CPU 16000000UL
#include <avr/io.h> /* Include AVR std. library file */
#include <util/delay.h> /* Include delay header file */
#include <stdlib.h> /* Include standard library file */
#include <stdio.h>
#include "twi.h"
#include "uart.h"
#include "MPU6050.h"
int main(void)
{
/* Replace with your application code */
FILE* fpStdio = fdevopen(usartTxChar,NULL);
UART_INIT();
printf("uart init ok\n");
i2c_init(); //I2C 통신 for MPU6050
printf("i2c init ok\n");
init_MPU6050(); //자이로센서 설정
printf("MPU6050 reset ok\n");
//pAngle_3Dim RollPitch_Result;
while (1)
{
compute_MPU6050(); //ROLL, PITCH, YAW 계산
_delay_ms(1000);
}
}