Problem implementing skip() functionality on buttons. #649
-
Hi everyone/Phil, I am an amateur engineer trying to make a bluetooth based speaker system. The code so far has been brilliant, however I am seriously struggling to implement basic button controls over the audio source. My code is a combination of this fine library with the Easybutton library. The buttons are nice and they debounce, but I have no idea how to make the play/pause, next, back and volume work when the buttons press. My code is as follows (only the skip function is implemented on button 2; more buttons will be added for the extra functions): #include <EasyButton.h> // ESP32 pins where the buttons are connected to #define BAUDRATE 115200 #include "ESP_I2S.h" const uint8_t I2S_SCK = 14; /* Audio data bit clock - Connect to PCM102 BCK*/ BluetoothA2DPSink a2dp_sink(i2s); // Button1 // Callback function to be called when button1 is pressed } // Callback function to be called when button2 is pressed void setup() a2dp_sink.start("My_Music"); // Initialize Serial for debuging purposes Serial.println(); // Initialize the button1 void loop() ERROR CODE is as follows: exit status 1 Compilation error: 'next' was not declared in this scope Sorry if this is something obvious that I should be able to find in the readme but I can't find it. Best wishes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Have a look at the class documentation: you need to call the methods on the instance: a2dp_sink.next() |
Beta Was this translation helpful? Give feedback.
Have a look at the class documentation: you need to call the methods on the instance: a2dp_sink.next()