Package jpigpio.sensors
Class WiiNunchuck
java.lang.Object
jpigpio.sensors.WiiNunchuck
public class WiiNunchuck
extends java.lang.Object
Wrapper for WiiNunchuck. The Wii Nunchuck is an I2C device and hence has to be connected
to the SDA and SCL pins of the Pi.
To use this class:
- Initialize Pigpio
- Call initialize()
- Call readValue()
- get the data fields ...
-
Constructor Summary
Constructors Constructor Description WiiNunchuck(JPigpio pigpio)
-
Method Summary
-
Constructor Details
-
Method Details
-
initialize
Initialize the Nunchuck- Throws:
PigpioException
-
close
- Throws:
PigpioException
-
readValue
Read a value from the Wii Nunchuck.- Throws:
PigpioException
-
getJoyX
public byte getJoyX() -
getJoyY
public byte getJoyY() -
getAccelX
public byte getAccelX() -
getAccelY
public byte getAccelY() -
getAccelZ
public byte getAccelZ() -
isButtonC
public boolean isButtonC() -
isButtonZ
public boolean isButtonZ() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-