USB_Host_Shield_2.0
|
#include <Wii.h>
Public Member Functions | |
WII (BTD *p, bool pair=false) | |
BluetoothService implementation | |
virtual void | ACLData (uint8_t *ACLData) |
virtual void | Run () |
virtual void | Reset () |
virtual void | disconnect () |
Wii Controller functions | |
bool | getButtonPress (Button b) |
bool | getButtonClick (Button b) |
uint8_t | getAnalogHat (Hat a) |
uint16_t | getAnalogHat (AnalogHat a) |
double | getPitch () |
double | getRoll () |
double | getYaw () |
void | setAllOff () |
void | setRumbleOff () |
void | setRumbleOn () |
void | setRumbleToggle () |
void | setLedOff (LED a) |
void | setLedOn (LED a) |
void | setLedToggle (LED a) |
void | setLedStatus () |
uint8_t | getBatteryLevel () |
uint8_t | getWiiState () |
Wiimote IR camera functions | |
You will have to uncomment #WIICAMERA in Wii.h to use the IR camera. | |
void | IRinitialize () |
uint16_t | getIRx1 () |
uint16_t | getIRy1 () |
uint8_t | getIRs1 () |
uint16_t | getIRx2 () |
uint16_t | getIRy2 () |
uint8_t | getIRs2 () |
uint16_t | getIRx3 () |
uint16_t | getIRy3 () |
uint8_t | getIRs3 () |
uint16_t | getIRx4 () |
uint16_t | getIRy4 () |
uint8_t | getIRs4 () |
bool | isIRCameraEnabled () |
Public Attributes | |
double | gyroPitch |
double | gyroRoll |
double | gyroYaw |
bool | wiimoteConnected |
bool | nunchuckConnected |
bool | motionPlusConnected |
bool | wiiUProControllerConnected |
double | wiimotePitch |
double | wiimoteRoll |
double | nunchuckPitch |
double | nunchuckRoll |
int16_t | accX |
int16_t | accY |
int16_t | accZ |
double | pitchGyroSpeed |
double | rollGyroSpeed |
double | yawGyroSpeed |
uint16_t | pitchGyroScale |
uint16_t | rollGyroScale |
uint16_t | yawGyroScale |
int16_t | gyroYawRaw |
int16_t | gyroRollRaw |
int16_t | gyroPitchRaw |
int16_t | gyroYawZero |
int16_t | gyroRollZero |
int16_t | gyroPitchZero |
This BluetoothService class implements support for the Wiimote including the Nunchuck and Motion Plus extension.
It also support the Wii U Pro Controller.
WII::WII | ( | BTD * | p, |
bool | pair = false |
||
) |
|
virtual |
Used to pass acldata to the services.
ACLData | Incoming acldata. |
Reimplemented from BluetoothService.
|
virtual |
Used this to disconnect any of the controllers.
Reimplemented from BluetoothService.
uint8_t WII::getAnalogHat | ( | Hat | a | ) |
uint16_t WII::getAnalogHat | ( | AnalogHat | a | ) |
|
inline |
bool WII::getButtonClick | ( | Button | b | ) |
getButtonPress(Button b) will return true as long as the button is held down While getButtonClick(Button b) will only return it once So you instance if you need to increase a variable once you would use getButtonClick(Button b), but if you need to drive a robot forward you would use getButtonPress(Button b).
bool WII::getButtonPress | ( | Button | b | ) |
getButtonPress(Button b) will return true as long as the button is held down While getButtonClick(Button b) will only return it once So you instance if you need to increase a variable once you would use getButtonClick(Button b), but if you need to drive a robot forward you would use getButtonPress(Button b).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the Wiimote state.
|
inline |
void WII::IRinitialize | ( | ) |
Initialises the camera as per the steps from: http://wiibrew.org/wiki/Wiimote#IR_Camera
|
inline |
Use this to check if the camera is enabled or not. If not call WII::IRinitialize to initialize the IR camera.
|
virtual |
Use this to reset the service.
Reimplemented from BluetoothService.
|
virtual |
Used to run part of the state maschine.
Reimplemented from BluetoothService.
void WII::setAllOff | ( | ) |
void WII::setLedOff | ( | LED | a | ) |
void WII::setLedOn | ( | LED | a | ) |
void WII::setLedStatus | ( | ) |
void WII::setLedToggle | ( | LED | a | ) |
int16_t WII::accX |
int16_t WII::accY |
int16_t WII::accZ |
double WII::gyroPitch |
This is the pitch calculated by the gyro - use this to tune WII::pitchGyroScale.
int16_t WII::gyroPitchRaw |
int16_t WII::gyroPitchZero |
double WII::gyroRoll |
This is the roll calculated by the gyro - use this to tune WII::rollGyroScale.
int16_t WII::gyroRollRaw |
int16_t WII::gyroRollZero |
double WII::gyroYaw |
This is the yaw calculated by the gyro - use this to tune WII::yawGyroScale.
int16_t WII::gyroYawRaw |
int16_t WII::gyroYawZero |
bool WII::motionPlusConnected |
bool WII::nunchuckConnected |
double WII::nunchuckPitch |
double WII::nunchuckRoll |
uint16_t WII::pitchGyroScale |
uint16_t WII::rollGyroScale |
bool WII::wiimoteConnected |
double WII::wiimotePitch |
double WII::wiimoteRoll |
bool WII::wiiUProControllerConnected |
uint16_t WII::yawGyroScale |