Package crackers.kobots.devices.io
Class GamepadQT
-
- All Implemented Interfaces:
-
com.diozero.api.DeviceInterface
,java.lang.AutoCloseable
public final class GamepadQT implements DeviceInterface
STEMMA QT Gamepad by Adafruit, running off a Seesaw microcontroller. Each of the buttons and joystick values are available as members of this class. The joystick values are 0-1023, and the buttons are true/false.
Product page: https://www.adafruit.com/product/5743
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
GamepadQT.GamepadButtons
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
DEFAULT_I2C_ADDRESS
public final static Integer
DEFAULT_I2C_BUS
private final Boolean
startButton
private final Boolean
selectButton
private final Boolean
aButton
private final Boolean
bButton
private final Boolean
xButton
private final Boolean
yButton
private final List<Boolean>
allButtons
private final Float
xAxis
private final Float
yAxis
-
Constructor Summary
Constructors Constructor Description GamepadQT(I2CDeviceInterface i2CDevice)
-
Method Summary
Modifier and Type Method Description final Boolean
getStartButton()
final Boolean
getSelectButton()
final Boolean
getAButton()
final Boolean
getBButton()
final Boolean
getXButton()
final Boolean
getYButton()
final List<Boolean>
getAllButtons()
final Float
getXAxis()
final Float
getYAxis()
final GamepadQT.GamepadButtons
read()
Unit
close()
-
-
Method Detail
-
getStartButton
final Boolean getStartButton()
-
getSelectButton
final Boolean getSelectButton()
-
getAButton
final Boolean getAButton()
-
getBButton
final Boolean getBButton()
-
getXButton
final Boolean getXButton()
-
getYButton
final Boolean getYButton()
-
getAllButtons
final List<Boolean> getAllButtons()
-
read
final GamepadQT.GamepadButtons read()
-
-
-
-