This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
machines-backup/components/hal/firmware/zoe/addons/MotorSpeed.h
2024-10-01 17:06:14 +02:00

41 lines
727 B
C++

#ifndef MOTOR_SPEED_H
#define MOTOR_SPEED_H
#include <Arduino.h>
#include "Addon.h"
#include "config.h"
#include <Streaming.h>
#include "../common/macros.h"
#include "IRSensor.h"
class MotorSpeed : public Addon
{
public:
MotorSpeed() :
sensor(new IRSensor()),
Addon(MOTOR_IR_SPEED_STR, MOTOR_SPEED) {}
virtual short setup()
{
sensor->setup();
}
virtual short ok()
{
return this->sensor->ok();
}
virtual short loop()
{
this->sensor->loop();
}
void debug(Stream *stream)
{
//*stream << this->name << ":" << this->ok();
}
void info(Stream *stream)
{
//*stream << this->name << "\n\t : " SPACE("Pin:" << MOTOR_IDLE_PIN);
}
protected:
IRSensor *sensor;
};
#endif