Files
esp8266_study/code/SmallCart/SmallCartMain/SmallCartMain.ino
2024-09-27 01:22:07 +08:00

38 lines
759 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "src/led/led.h"
#include "src/config/config.h"
#include "src/wifi/wifi.h"
#include "src/motion/motion.h"
#include "src/web/web.h"
#include "src/socket/socket.h"
#include "src/buzzer/buzzer.h"
Web web;
Socket socket;
ConfigWifi wifi;
Motion motion;
Buzzer buzzer;
void setup()
{
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
// 初始化wifiap模式
wifi.init();
// 初始化电机驱动的各个引脚 和 舵机,和运动方法封装
motion.init();
// 蜂鸣器
buzzer.init();
// 初始化 websocket 服务
socket.init();
// 初始化 httpServer 服务主要加载Web的控制面板
web.init();
}
void loop()
{
socket.Server->loop();
web.WebController->handleClient();
}