#include <POT.h>
Definition at line 21 of file POT.h.
◆ POT()
POT::POT |
( |
Component * |
owner, |
|
|
short |
_pin, |
|
|
short |
_id, |
|
|
short |
_addr |
|
) |
| |
|
inline |
Definition at line 25 of file POT.h.
29 : ModbusValue<int>(_addr, MB_FC::MB_FC_READ_REGISTERS),
30 Component(
"POT", _id, Component::COMPONENT_DEFAULT, owner),
35 SBI(nFlags, OBJECT_NET_CAPS::E_NCAPS_MODBUS);
36 setRegisterMode(MB_REGISTER_MODE::E_MB_REGISTER_MODE_READ);
◆ debug()
Definition at line 48 of file POT.h.
51 #ifdef PLATFORM_PORTENTA_H7_M7
52 Log.verbose(F(
"POT:debug pin=%d value=%d | %d" CR),
pin,
value, analog_in.read(
pin));
◆ info()
short POT::info |
( |
short |
val0, |
|
|
short |
val1 |
|
) |
| |
|
inline |
Definition at line 58 of file POT.h.
60 Log.verboseln(
"POT::info - Pin=%d | Key=%d | Addr=%d | Val=%d | NetVal=%d ",
pin,
id, addr,
value, netVal());
◆ loop()
Definition at line 63 of file POT.h.
70 #ifdef PLATFORM_PORTENTA_H7_M7
71 float raw_voltage_ch0 = analog_in.read(
pin);
72 float voltage_ch0 = (raw_voltage_ch0 * reference) / 65535 / res_divider;
◆ onRegisterMethods()
short POT::onRegisterMethods |
( |
Bridge * |
bridge | ) |
|
|
inline |
Definition at line 81 of file POT.h.
83 bridge->registerMemberFunction(
id,
this, C_STR(
"setFlag"), (ComponentFnPtr)&POT::setFlag);
85 bridge->registerMemberFunction(
id,
this, C_STR(
"info"), (ComponentFnPtr)&
POT::info);
◆ setup()
Definition at line 38 of file POT.h.
40 #ifdef PLATFORM_PORTENTA_H7_M7
41 analogReadResolution(16);
◆ last_value
Definition at line 90 of file POT.h.
◆ pin
Definition at line 88 of file POT.h.
◆ value
Definition at line 89 of file POT.h.
The documentation for this class was generated from the following file: