LED and MOTOR "ON" when A BLE DEVICE APPROACH ESP32 MICROCONTROLLER DFR0575

Hello,

I have this code that is working perfectly but I want my device to start vibrating too (right now only the led is working)

On a Wemos Battery Module I have simply connected the vibration motor on the same PIN of the LED and it works perfectly.

Now I want to do the same on an Beetle ESP32 Microcontroller DFR0575. I used the same code But I can't make the module vibrating (The led is working perfectly)

THE CODE

 #include <BLEAdvertisedDevice.h>
   #include <BLEDevice.h>
   #include <BLEScan.h>
   
   const int PIN = 2;
   const int CUTOFF = -50;
   
   
   void setup() {
     pinMode(PIN, OUTPUT);
     BLEDevice::init("tkr");
   }
   
   void loop() {
     BLEScan *scan = BLEDevice::getScan();
     scan->setActiveScan(true);
     BLEScanResults results = scan->start(1);
     int best = CUTOFF;
     for (int i = 0; i < results.getCount(); i++) {
       BLEAdvertisedDevice device = results.getDevice(i);
       int rssi = device.getRSSI();
       if (rssi > best) {
         best = rssi;
       }
     }
     digitalWrite(PIN, best > CUTOFF ? HIGH : LOW);
   }

Please read 'how to use this forum - please read', especially item #7, the go back and edit you post accordingly.

You are more likely to get helpful, friendly advice if you follow the forum rules.

Thank you.

Ok I did it, thanks.