mirror of
https://github.com/avem-labs/Avem.git
synced 2023-09-01 15:18:49 +08:00
[MOD]: Enhancement
This commit is contained in:
parent
8be9556960
commit
0716b65a3e
@ -8,7 +8,8 @@ void delay_us(volatile unsigned int nus) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IIC_init() {
|
void IIC_init() {
|
||||||
RCC->APB2ENR |= 1<<3; //GPIOB enable
|
// RCC->APB2ENR |= 1<<3; //GPIOB enable
|
||||||
|
RCC->APB2ENR |= RCC_APB2RSTR_IOPBRST;
|
||||||
GPIOB->CRH &= 0x0F0FFFFF; //reset B13 & B15
|
GPIOB->CRH &= 0x0F0FFFFF; //reset B13 & B15
|
||||||
GPIOB->CRH |= 0x70700000; //Set B13 & B15 b0111
|
GPIOB->CRH |= 0x70700000; //Set B13 & B15 b0111
|
||||||
GPIOB->ODR |= 5<<5;
|
GPIOB->ODR |= 5<<5;
|
||||||
|
@ -98,17 +98,21 @@ void Comput(SixAxis cache) {
|
|||||||
g_Yaw = atan2(2 * (g_q1 * g_q2 + g_q0 * g_q3), g_q0*g_q0 + g_q1*g_q1 - g_q2*g_q2 - g_q3*g_q3) * 57.3;
|
g_Yaw = atan2(2 * (g_q1 * g_q2 + g_q0 * g_q3), g_q0*g_q0 + g_q1*g_q1 - g_q2*g_q2 - g_q3*g_q3) * 57.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEBUG_WIFI
|
//#define DEBUG_WIFI
|
||||||
|
#define DEBUG_MPU6050_EULER //Do not comment this, even not work
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
|
SixAxis sourceData;
|
||||||
wifi_Config();
|
wifi_Config();
|
||||||
|
|
||||||
while(0) {
|
#ifdef DEBUG_WIFI
|
||||||
|
while(1) {
|
||||||
wifi_sendCmd("AT+CIPSEND=0,20");
|
wifi_sendCmd("AT+CIPSEND=0,20");
|
||||||
delay(50);
|
delay(50);
|
||||||
wifi_sendCmd("<html>aki<br></html>");
|
wifi_sendCmd("<html>aki<br></html>");
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
initLED();
|
initLED();
|
||||||
|
|
||||||
@ -119,7 +123,6 @@ int main() {
|
|||||||
MPU_init();
|
MPU_init();
|
||||||
|
|
||||||
|
|
||||||
SixAxis sourceData;
|
|
||||||
|
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user