mirror of
https://github.com/avem-labs/Avem.git
synced 2023-09-01 15:18:49 +08:00
Update
This commit is contained in:
parent
f9996f8672
commit
6e6137a02f
@ -7,6 +7,7 @@
|
||||
|
||||
void wifi_init();
|
||||
void wifi_sendSingleByte(unsigned char cmd);
|
||||
void wifi_sendData();
|
||||
void wifi_sendData(char * cmd);
|
||||
void wifi_sendCmd(char * cmd);
|
||||
|
||||
#endif
|
||||
|
@ -33,6 +33,18 @@ void wifi_sendSingleByte(unsigned char cmd) {
|
||||
while((USART3->SR & 0x40) == 0);
|
||||
}
|
||||
|
||||
void wifi_sendData() {
|
||||
void wifi_sendData(char * cmd) {
|
||||
unsigned short pointer = 0;
|
||||
while(*(cmd + pointer)) {
|
||||
wifi_sendSingleByte((unsigned char)*(cmd + pointer));
|
||||
pointer++;
|
||||
}
|
||||
|
||||
wifi_sendSingleByte(0x0D);
|
||||
wifi_sendSingleByte(0x0A);
|
||||
}
|
||||
|
||||
void wifi_sendCmd(char * cmd) {
|
||||
wifi_sendData("AT+");
|
||||
wifi_sendData(cmd);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "mpu6050.h"
|
||||
#include "motor.h"
|
||||
#include "uart.h"
|
||||
|
||||
#include "wifi.h"
|
||||
#include "key.h"
|
||||
|
||||
#define Kp 100.0f //比例增益支配率(常量)
|
||||
@ -111,6 +111,11 @@ int main() {
|
||||
|
||||
uart_init(72, 115200);
|
||||
MPU_init();
|
||||
|
||||
wifi_init();
|
||||
|
||||
wifi_sendCmd("CWMODE=2");
|
||||
|
||||
SixAxis sourceData;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user