53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
#ifndef _MAIN_H
|
|
#define _MAIN_H
|
|
|
|
// 机器人控制头文件
|
|
#include <MPU6050_tockn.h>
|
|
#include "Servo_STS3032.h"
|
|
#include <SimpleFOC.h>
|
|
#include <Arduino.h>
|
|
|
|
// wifi控制数据传输头文件
|
|
#include <WebSocketsServer.h>
|
|
#include <ArduinoJson.h>
|
|
#include <WebServer.h>
|
|
#include <WiFi.h>
|
|
#include <FS.h>
|
|
#include "basic_web.h"
|
|
#include "robot.h"
|
|
#include "wifi_config.h"
|
|
#include "esp_adc_cal.h"
|
|
|
|
// 网页控制回调函数
|
|
void basicWebCallback(void);
|
|
void webSocketEventCallback(uint8_t num, WStype_t type, uint8_t *payload, size_t length);
|
|
void web_loop();
|
|
|
|
// 电压检测函数
|
|
void adc_calibration_init();
|
|
void bat_check();
|
|
|
|
// 平衡算法函数
|
|
void lqr_balance_loop();
|
|
void yaw_loop();
|
|
void leg_loop();
|
|
void jump_loop();
|
|
void yaw_angle_addup();
|
|
|
|
void resetToDefault();
|
|
void safeSyncWritePosEx(byte* id, byte idCount, s16* position, u16* speed, byte* acc);
|
|
|
|
// 蓝牙相关函数
|
|
void saveBluetoothAddress(const String& addr);
|
|
String loadBluetoothAddress();
|
|
void resetBluetoothAddressAndRestart();
|
|
void handleSerialCommands();
|
|
void handleBluetoothData();
|
|
void processXboxControllerData();
|
|
|
|
// 警灯相关函数
|
|
void startPoliceLights(int speed, int repeats);
|
|
void updatePoliceLights();
|
|
|
|
#endif
|