mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Don't print R2 and right joystick if a Navigation controller is connected
This commit is contained in:
parent
0397a3f088
commit
47ab932c0f
3 changed files with 18 additions and 10 deletions
|
@ -43,9 +43,11 @@ void loop() {
|
||||||
if(PS3.getAnalogButton(L2_ANALOG) > 0 || PS3.getAnalogButton(R2_ANALOG) > 0) {
|
if(PS3.getAnalogButton(L2_ANALOG) > 0 || PS3.getAnalogButton(R2_ANALOG) > 0) {
|
||||||
Serial.print(F("\r\nL2: "));
|
Serial.print(F("\r\nL2: "));
|
||||||
Serial.print(PS3.getAnalogButton(L2_ANALOG));
|
Serial.print(PS3.getAnalogButton(L2_ANALOG));
|
||||||
|
if(!PS3.PS3NavigationConnected) {
|
||||||
Serial.print(F("\tR2: "));
|
Serial.print(F("\tR2: "));
|
||||||
Serial.print(PS3.getAnalogButton(R2_ANALOG));
|
Serial.print(PS3.getAnalogButton(R2_ANALOG));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(PS3.getButtonClick(PS)) {
|
if(PS3.getButtonClick(PS)) {
|
||||||
Serial.print(F("\r\nPS"));
|
Serial.print(F("\r\nPS"));
|
||||||
PS3.disconnect();
|
PS3.disconnect();
|
||||||
|
|
|
@ -50,9 +50,11 @@ void loop() {
|
||||||
if(PS3[i]->getAnalogButton(L2_ANALOG) > 0 || PS3[i]->getAnalogButton(R2_ANALOG) > 0) {
|
if(PS3[i]->getAnalogButton(L2_ANALOG) > 0 || PS3[i]->getAnalogButton(R2_ANALOG) > 0) {
|
||||||
Serial.print(F("\r\nL2: "));
|
Serial.print(F("\r\nL2: "));
|
||||||
Serial.print(PS3[i]->getAnalogButton(L2_ANALOG));
|
Serial.print(PS3[i]->getAnalogButton(L2_ANALOG));
|
||||||
|
if(!PS3[i]->PS3NavigationConnected) {
|
||||||
Serial.print(F("\tR2: "));
|
Serial.print(F("\tR2: "));
|
||||||
Serial.print(PS3[i]->getAnalogButton(R2_ANALOG));
|
Serial.print(PS3[i]->getAnalogButton(R2_ANALOG));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(PS3[i]->getButtonClick(PS)) {
|
if(PS3[i]->getButtonClick(PS)) {
|
||||||
Serial.print(F("\r\nPS"));
|
Serial.print(F("\r\nPS"));
|
||||||
PS3[i]->disconnect();
|
PS3[i]->disconnect();
|
||||||
|
|
|
@ -55,20 +55,24 @@ void loop() {
|
||||||
output += PS3.getAnalogHat(LeftHatX);
|
output += PS3.getAnalogHat(LeftHatX);
|
||||||
output += "\tLeftHatY: ";
|
output += "\tLeftHatY: ";
|
||||||
output += PS3.getAnalogHat(LeftHatY);
|
output += PS3.getAnalogHat(LeftHatY);
|
||||||
|
if(!PS3.PS3NavigationConnected) {
|
||||||
output += "\tRightHatX: ";
|
output += "\tRightHatX: ";
|
||||||
output += PS3.getAnalogHat(RightHatX);
|
output += PS3.getAnalogHat(RightHatX);
|
||||||
output += "\tRightHatY: ";
|
output += "\tRightHatY: ";
|
||||||
output += PS3.getAnalogHat(RightHatY);
|
output += PS3.getAnalogHat(RightHatY);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//Analog button values can be read from almost all buttons
|
//Analog button values can be read from almost all buttons
|
||||||
if(PS3.getAnalogButton(L2_ANALOG) || PS3.getAnalogButton(R2_ANALOG)) {
|
if(PS3.getAnalogButton(L2_ANALOG) || PS3.getAnalogButton(R2_ANALOG)) {
|
||||||
if(output != "")
|
if(output != "")
|
||||||
output += "\r\n";
|
output += "\r\n";
|
||||||
output += "L2: ";
|
output += "L2: ";
|
||||||
output += PS3.getAnalogButton(L2_ANALOG);
|
output += PS3.getAnalogButton(L2_ANALOG);
|
||||||
|
if(!PS3.PS3NavigationConnected) {
|
||||||
output += "\tR2: ";
|
output += "\tR2: ";
|
||||||
output += PS3.getAnalogButton(R2_ANALOG);
|
output += PS3.getAnalogButton(R2_ANALOG);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(output != "") {
|
if(output != "") {
|
||||||
Serial.println(output);
|
Serial.println(output);
|
||||||
if(SerialBT.connected)
|
if(SerialBT.connected)
|
||||||
|
|
Loading…
Reference in a new issue