IoAbstraction
Classes | Functions
JoystickSwitchInput.h File Reference

Provides a rotary encoder emulation based on an analog joystick. Normally used with switches to provide an encoder for your project. More...

Go to the source code of this file.

Classes

class  JoystickSwitchInput
 
class  AnalogJoystickToButtons
 

Functions

void setupAnalogJoystickEncoder (AnalogDevice *analogDevice, pinid_t analogPin, EncoderCallbackFn callback)
 
IoAbstractionRef joystickTwoButtonExpander (AnalogDevice *analogDevice, pinid_t analogPin, float centrePoint)
 

Detailed Description

Provides a rotary encoder emulation based on an analog joystick. Normally used with switches to provide an encoder for your project.

Function Documentation

◆ setupAnalogJoystickEncoder()

void setupAnalogJoystickEncoder ( AnalogDevice analogDevice,
pinid_t  analogPin,
EncoderCallbackFn  callback 
)
inline

This is the preferred way to create an instance of a joystick encoder and set it as the default encoder for switches library.

Parameters
analogDevicea pointer to an analog device - See example for more detail.
analogPinthe pin onto which the joystick is connected
callbackthe callback that will receive changes in value