mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
start version
This commit is contained in:
25
include/Servo/Servos.h
Normal file
25
include/Servo/Servos.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <Servo.h>
|
||||
|
||||
struct Servo_t {
|
||||
uint8_t num;
|
||||
uint8_t pin;
|
||||
Servo* obj;
|
||||
Servo_t(uint8_t num, uint8_t pin) : num{num}, pin{pin}, obj{nullptr} {};
|
||||
};
|
||||
|
||||
class Servos {
|
||||
public:
|
||||
Servos();
|
||||
Servo* get(uint8_t num);
|
||||
Servo* create(uint8_t num, uint8_t pin);
|
||||
|
||||
size_t count();
|
||||
|
||||
private:
|
||||
std::vector<Servo_t> _items;
|
||||
};
|
||||
|
||||
extern Servos myServo;
|
||||
Reference in New Issue
Block a user