libstp
Robotics library for Botball
Loading...
Searching...
No Matches
Analog.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
hal/PortRegistry.hpp
"
4
5
namespace
libstp::hal::analog
6
{
14
class
AnalogSensor
15
{
16
#ifdef SAFETY_CHECKS_ENABLED
17
static
inline
detail::PortRegistry registry_{};
18
static
void
registerAnalogPort(
int
port
);
19
static
void
unregisterAnalogPort(
int
port
);
20
#endif
21
22
public
:
23
int
port
;
24
26
explicit
AnalogSensor
(
int
port
);
27
28
virtual
~AnalogSensor
();
29
31
virtual
int
read
()
const
;
32
};
33
}
PortRegistry.hpp
libstp::hal::analog::AnalogSensor::~AnalogSensor
virtual ~AnalogSensor()
libstp::hal::analog::AnalogSensor::port
int port
Definition
Analog.hpp:23
libstp::hal::analog::AnalogSensor::read
virtual int read() const
Read the current raw analog value from the selected platform.
libstp::hal::analog::AnalogSensor::AnalogSensor
AnalogSensor(int port)
Create an analog sensor bound to a platform-defined port index.
libstp::hal::analog
Definition
Analog.hpp:6
modules
libstp-hal
include
hal
Analog.hpp
Generated by
1.15.0