mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Servo control
This commit is contained in:
@@ -10,19 +10,16 @@
|
||||
|
||||
#include "esp_log.h"
|
||||
|
||||
#define ACTUATOR_CMD_TAG 5
|
||||
|
||||
[[noreturn]] void LoopManager::control_loop() {
|
||||
const auto messaging_interface = std::make_unique<MessagingInterface>(std::make_unique<WifiManager>());
|
||||
|
||||
char buffer[512];
|
||||
const auto actuator = ActuatorFactory::create_actuator(ConfigManager::get_module_type());
|
||||
|
||||
uint8_t buffer[512];
|
||||
while (true) {
|
||||
messaging_interface->recv(buffer, 512, 0, 1);
|
||||
//std::cout << buffer << std::endl;
|
||||
|
||||
std::string s = std::format("num {} bo", ConfigManager::get_module_id());
|
||||
messaging_interface->send(s.data(), s.size(), 0, 2, true);
|
||||
|
||||
ESP_LOGI("MEM", "Free internal RAM: %d", heap_caps_get_free_size(MALLOC_CAP_8BIT));
|
||||
ESP_LOGI("MEM", "Free PSRAM: %d", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
|
||||
|
||||
messaging_interface->recv(reinterpret_cast<char *>(buffer), 512, PC_ADDR, ACTUATOR_CMD_TAG);
|
||||
actuator->actuate(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user