How do I convert the recieved metadata to string so that I can show it on an SPI TFT display. #383
-
Hello sir, I am building a bluetooth speaker with a TFT display, I have an i2s amp connected and using A2DP sink , I want to show the metadata recieved on the tft but I don't know how to convert it to a string. I get the title, and time on the serial monitor but Also want to show things like the volume , artist, title , time etc and whatever possible but I don't know how to. So sorry I am not an expert in programming. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Why don't just just look at the provided example and try it out? To decode the id you can use https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/esp_avrc.html#_CPPv423esp_avrc_md_attr_mask_t |
Beta Was this translation helpful? Give feedback.
-
I'm really Sorrry sir. Here's my code, i need to print the song title on the TFT in the loop funciton. #include <TFT_eSPI.h> #include "BluetoothA2DPSink.h" void setup(void) { i2s_pin_config_t my_pin_config = void avrc_metadata_callback(uint8_t data1, const uint8_t *data2) { void loop() { |
Beta Was this translation helpful? Give feedback.
-
I would try the following first: void avrc_metadata_callback(uint8_t typ, const uint8_t *text) {
if (typ== ESP_AVRC_MD_ATTR_TITLE){
tft.fillScreen(TFT_GREY);
tft.setCursor(0, 0, 2);
tft.setTextColor(TFT_WHITE,TFT_BLACK);
tft.setTextSize(1);
tft.println(text);
}
}
void loop() {
}
|
Beta Was this translation helpful? Give feedback.
Why don't just just look at the provided example and try it out?
Your question does not make any sense because you can see that you are actually getting strings...
To decode the id you can use https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/esp_avrc.html#_CPPv423esp_avrc_md_attr_mask_t