I'm a beginner in programming with Arduino and I have the following issue:
I want to connect my ESP32 with a PS4 Controller, and I'm using this code:
#include <PS4Controller.h>
void setup() {
Serial.begin(115200);
PS4.begin("01:01:01:01:01:01");
Serial.println("Initialization ready!");
}
void loop() {
if (PS4.isConnected()) {
Serial.println("Controller connected");
}
delay(1000);
}
from
(ESP32: Connecting a PS4 Controller - techtutorialsx)
but I get this error:
C:\Users\####\OneDrive\Dokumente\Arduino\libraries\PS4-esp32-master\src\ps4_spp.c: In function 'sppCallback':
C:\Users\####\OneDrive\Dokumente\Arduino\libraries\PS4-esp32-master\src\ps4_spp.c:87:30: error: 'ESP_BT_CONNECTABLE' undeclared (first use in this function)
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_NON_DISCOVERABLE);
^
C:\Users\####\OneDrive\Dokumente\Arduino\libraries\PS4-esp32-master\src\ps4_spp.c:87:30: note: each undeclared identifier is reported only once for each function it appears in
C:\Users\####\OneDrive\Dokumente\Arduino\libraries\PS4-esp32-master\src\ps4_spp.c:87:50: error: 'ESP_BT_NON_DISCOVERABLE' undeclared (first use in this function)
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_NON_DISCOVERABLE);
^
C:\Users\####\OneDrive\Dokumente\Arduino\libraries\PS4-esp32-master\src\ps4_spp.c:87:5: error: too many arguments to function 'esp_bt_gap_set_scan_mode'
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_NON_DISCOVERABLE);
^
In file included from C:\Users\####\OneDrive\Dokumente\Arduino\libraries\PS4-esp32-master\src\ps4_spp.c:4:0:
C:\Users\####\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/bt/esp_gap_bt_api.h:370:11: note: declared here
esp_err_t esp_bt_gap_set_scan_mode(esp_bt_scan_mode_t mode);
^
exit status 1
Fehler beim Kompilieren fΓΌr das Board ESP32 Wrover Module.
My PS4 Controller have already this Bluetooth adress:
To begin I've tried to upload the arduino sketch example "Blink" to the ESP32 and that worked fine...
I can't find the issue and I would be pleased if somebody could help me