mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Add distance sensor, rewrite OLED to use new i2c library
This commit is contained in:
15
main/control/SensorFactory.cpp
Normal file
15
main/control/SensorFactory.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "control/SensorFactory.h"
|
||||
#include "control/DistanceSensor.h"
|
||||
#include "flatbuffers_generated/RobotModule_generated.h"
|
||||
|
||||
std::unique_ptr<ISensor> SensorFactory::create_sensor(const ModuleType type) {
|
||||
switch (type) {
|
||||
case ModuleType_DISTANCE_SENSOR:
|
||||
return std::make_unique<DistanceSensor>();
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user