From 47ab932c0f4d6b1d6dd130f49827dca97e86f619 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Sun, 20 Jan 2013 22:30:53 +0100 Subject: [PATCH] Don't print R2 and right joystick if a Navigation controller is connected --- examples/Bluetooth/PS3BT/PS3BT.ino | 6 ++++-- examples/Bluetooth/PS3Multi/PS3Multi.ino | 6 ++++-- examples/Bluetooth/PS3SPP/PS3SPP.ino | 16 ++++++++++------ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/examples/Bluetooth/PS3BT/PS3BT.ino b/examples/Bluetooth/PS3BT/PS3BT.ino index 35e57a23..3b3561e7 100644 --- a/examples/Bluetooth/PS3BT/PS3BT.ino +++ b/examples/Bluetooth/PS3BT/PS3BT.ino @@ -43,8 +43,10 @@ void loop() { if(PS3.getAnalogButton(L2_ANALOG) > 0 || PS3.getAnalogButton(R2_ANALOG) > 0) { Serial.print(F("\r\nL2: ")); Serial.print(PS3.getAnalogButton(L2_ANALOG)); - Serial.print(F("\tR2: ")); - Serial.print(PS3.getAnalogButton(R2_ANALOG)); + if(!PS3.PS3NavigationConnected) { + Serial.print(F("\tR2: ")); + Serial.print(PS3.getAnalogButton(R2_ANALOG)); + } } if(PS3.getButtonClick(PS)) { Serial.print(F("\r\nPS")); diff --git a/examples/Bluetooth/PS3Multi/PS3Multi.ino b/examples/Bluetooth/PS3Multi/PS3Multi.ino index dbb111e7..23e18362 100644 --- a/examples/Bluetooth/PS3Multi/PS3Multi.ino +++ b/examples/Bluetooth/PS3Multi/PS3Multi.ino @@ -50,8 +50,10 @@ void loop() { if(PS3[i]->getAnalogButton(L2_ANALOG) > 0 || PS3[i]->getAnalogButton(R2_ANALOG) > 0) { Serial.print(F("\r\nL2: ")); Serial.print(PS3[i]->getAnalogButton(L2_ANALOG)); - Serial.print(F("\tR2: ")); - Serial.print(PS3[i]->getAnalogButton(R2_ANALOG)); + if(!PS3[i]->PS3NavigationConnected) { + Serial.print(F("\tR2: ")); + Serial.print(PS3[i]->getAnalogButton(R2_ANALOG)); + } } if(PS3[i]->getButtonClick(PS)) { Serial.print(F("\r\nPS")); diff --git a/examples/Bluetooth/PS3SPP/PS3SPP.ino b/examples/Bluetooth/PS3SPP/PS3SPP.ino index 8e12364a..e857897a 100644 --- a/examples/Bluetooth/PS3SPP/PS3SPP.ino +++ b/examples/Bluetooth/PS3SPP/PS3SPP.ino @@ -55,10 +55,12 @@ void loop() { output += PS3.getAnalogHat(LeftHatX); output += "\tLeftHatY: "; output += PS3.getAnalogHat(LeftHatY); - output += "\tRightHatX: "; - output += PS3.getAnalogHat(RightHatX); - output += "\tRightHatY: "; - output += PS3.getAnalogHat(RightHatY); + if(!PS3.PS3NavigationConnected) { + output += "\tRightHatX: "; + output += PS3.getAnalogHat(RightHatX); + output += "\tRightHatY: "; + output += PS3.getAnalogHat(RightHatY); + } } //Analog button values can be read from almost all buttons if(PS3.getAnalogButton(L2_ANALOG) || PS3.getAnalogButton(R2_ANALOG)) { @@ -66,8 +68,10 @@ void loop() { output += "\r\n"; output += "L2: "; output += PS3.getAnalogButton(L2_ANALOG); - output += "\tR2: "; - output += PS3.getAnalogButton(R2_ANALOG); + if(!PS3.PS3NavigationConnected) { + output += "\tR2: "; + output += PS3.getAnalogButton(R2_ANALOG); + } } if(output != "") { Serial.println(output);