The Controller
class provides a convenience for reading multiple GPIOs at once
and mapping their state to common controller buttons. It can optionally be
configured to support joystick select, as well as to convert analog joystick
values into digital directional values (up/down/left/right). It can also be used
for just a subset of the buttons, should you wish to do so, by providing the
GPIO configuration for the unused buttons to be -1.
The example shows how to use the Controller
component to create
various different controller interface objects, such as:
DigitalConfig
) with only a couple of buttons (such as NES)espp::OneshotAdc
class with the Joystickespp::Ads1x15
component to read 4 analog axes over I2C.idf.py add-dependency "espp/controller^0.22.0"