From b9220a90e6d5df5211079d9f40174af2c8b3cf52 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Wed, 20 Jan 2016 01:07:26 +0100 Subject: [PATCH] Updated PS3BT example, so it demonstrates rumble functionality --- examples/Bluetooth/PS3BT/PS3BT.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/Bluetooth/PS3BT/PS3BT.ino b/examples/Bluetooth/PS3BT/PS3BT.ino index b8967344..610269bb 100644 --- a/examples/Bluetooth/PS3BT/PS3BT.ino +++ b/examples/Bluetooth/PS3BT/PS3BT.ino @@ -21,8 +21,7 @@ BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so PS3BT PS3(&Btd); // This will just create the instance //PS3BT PS3(&Btd, 0x00, 0x15, 0x83, 0x3D, 0x0A, 0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch -bool printTemperature; -bool printAngle; +bool printTemperature, printAngle; void setup() { Serial.begin(115200); @@ -61,15 +60,20 @@ void loop() { Serial.print(PS3.getAnalogButton(R2)); } } + if (PS3.getButtonClick(PS)) { Serial.print(F("\r\nPS")); PS3.disconnect(); } else { - if (PS3.getButtonClick(TRIANGLE)) + if (PS3.getButtonClick(TRIANGLE)) { Serial.print(F("\r\nTraingle")); - if (PS3.getButtonClick(CIRCLE)) + PS3.setRumbleOn(RumbleLow); + } + if (PS3.getButtonClick(CIRCLE)) { Serial.print(F("\r\nCircle")); + PS3.setRumbleOn(RumbleHigh); + } if (PS3.getButtonClick(CROSS)) Serial.print(F("\r\nCross")); if (PS3.getButtonClick(SQUARE))