mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Orientation
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
#include <OrientationDetection.h>
|
||||
#include <WifiManager.h>
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -40,6 +41,7 @@ public:
|
||||
m_pc_connection(std::move(pc_connection)),
|
||||
m_module_id(ConfigManager::get_module_id()),
|
||||
m_last_leader_updated(std::chrono::system_clock::now()){
|
||||
OrientationDetection::init();
|
||||
update_leader();
|
||||
|
||||
xTaskCreate(router_thread, "communication_router", 4096, this, 3, &this->m_router_thread);
|
||||
|
||||
20
components/rpc/include/OrientationDetection.h
Normal file
20
components/rpc/include/OrientationDetection.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Created by Johnathon Slightham on 2025-07-26.
|
||||
//
|
||||
|
||||
#ifndef ORIENTATIONDETECTION_H
|
||||
#define ORIENTATIONDETECTION_H
|
||||
#include <flatbuffers_generated/RobotModule_generated.h>
|
||||
#include "driver/gpio.h"
|
||||
|
||||
class OrientationDetection {
|
||||
public:
|
||||
static void init();
|
||||
static Orientation get_orientation(uint8_t channel);
|
||||
|
||||
private:
|
||||
static void setup_gpio(gpio_num_t pin);
|
||||
|
||||
};
|
||||
|
||||
#endif //ORIENTATIONDETECTION_H
|
||||
Reference in New Issue
Block a user