From 89efe6340a4943be4f90180ff917409890554dc9 Mon Sep 17 00:00:00 2001 From: BigTire Date: Fri, 18 Nov 2022 09:53:02 +0100 Subject: [PATCH] Edit player 2. vibration when connect. --- bluetooth/player2/player2.ino | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bluetooth/player2/player2.ino b/bluetooth/player2/player2.ino index c050c74..1415099 100644 --- a/bluetooth/player2/player2.ino +++ b/bluetooth/player2/player2.ino @@ -14,8 +14,8 @@ BluetoothSerial SerialBT; #define BT_DISCOVER_TIME 10000 -esp_spp_sec_t sec_mask=ESP_SPP_SEC_NONE; // or ESP_SPP_SEC_ENCRYPT|ESP_SPP_SEC_AUTHENTICATE to request pincode confirmation -esp_spp_role_t role=ESP_SPP_ROLE_SLAVE; // or ESP_SPP_ROLE_MASTER +esp_spp_sec_t sec_mask=ESP_SPP_SEC_NONE; +esp_spp_role_t role=ESP_SPP_ROLE_SLAVE; @@ -36,15 +36,11 @@ void setup() { Serial.println("========== serialBT failed!"); abort(); } - // SerialBT.setPin("1234"); // doesn't seem to change anything - // SerialBT.enableSSP(); // doesn't seem to change anything Serial.println("Starting discoverAsync..."); BTScanResults* btDeviceList = SerialBT.getScanResults(); // maybe accessing from different threads! if (SerialBT.discoverAsync([](BTAdvertisedDevice* pDevice) { - // BTAdvertisedDeviceSet*set = reinterpret_cast(pDevice); - // btDeviceList[pDevice->getAddress()] = * set; Serial.printf(">>>>>>>>>>>Found a new device asynchronously: %s\n", pDevice->toString().c_str()); } ) ) { @@ -72,6 +68,9 @@ void setup() { } if(addr) { Serial.printf("connecting to %s - %d\n", addr.toString().c_str(), channel); + M5.Axp.SetLDOEnable(3, true); + delay(500); + M5.Axp.SetLDOEnable(3, false); SerialBT.connect(addr, channel, sec_mask, role); } } else { @@ -313,4 +312,4 @@ void loop() { } } } -} +} \ No newline at end of file