7class AnalogInput :
public Interface {
10 Interface::Type getType()
const override {
13 AnalogInput(Interface::Resolution res = Interface::RES_12BIT) : resolution(res) {
16 Interface::Resolution getResolution()
const {
19 void setQ(uint16_t q)
override {
20 if(q > ((1 << resolution) - 1)) {
21 WARNING_PRINTLN(
"[AnalogInput] WARNING: Attempted to set value " + String(q) +
" which exceeds the maximum for resolution " + String(resolution) +
" bits. Clamping to max value.");
22 Q = (1 << resolution) - 1;
25 DEBUG_PRINTLN(
"[AnalogInput] " + name +
" set to " + String(Q));
29 Interface::Resolution resolution = Interface::RES_12BIT;