Следующий код выведет std::string в Serial как последовательность Hex-символов. Его можно легко адаптировать для работы с другими типами строк.
print_string_hex_arduino.cpp
const char* cstr = str.c_str();
for (size_t i = 0; i < str.size(); i++)
{
Serial.printf("%02X ", cstr[i]);
}Этот код основан на нашем предыдущем посте Как вывести байт как две hex-цифры в Arduino
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow