Forum: Mikrocontroller und Digitale Elektronik Arduino USB Host Shield Bluetooth Library


von Carlo C. (caprez95)


Lesenswert?

Liebe Community

Ich nutze für ein Projekt einen Arduino Pro mini mit einem USB Host 
Shield, um einen PS4 Controller per Bluetooth zu verbinden.
Das funktioniert auch einwandfrei.
Das Problem was ich habe ist, dass man bereits im Code bestimmen muss, 
ob der USB Bluetooth Adapter im Pairing-Mode sein soll oder nicht.

// This will start an inquiry and then pair with the PS4 controller - 
you only have to do this once
// You will need to hold down the PS and Share button at the same time, 
the PS4 controller will then start to blink rapidly indicating that it 
is in pairing mode
//PS4BT PS4(&Btd, PAIR);
// After that you can simply create the instance like so and then press 
the PS button on the device
PS4BT PS4(&Btd);

Gibt es eine Möglichkeit, wo ich während der Laufzeit  (z.B. über einen 
Digitaleingang) den Bluetooth Adapter in den Pairing-Mode versetzen 
kann?

Gruss Carlo

von Carlo C. (caprez95)


Lesenswert?

Ich habs herausgefunden:
Sobald man "PS4.pair()" im Setup aufruft, wechselt der Bluetooth Dongle 
in den Pairing Mode.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.