Skip to content

How to get ACSelect value as string? #416

Answered by Hieromon
fruktiz32 asked this question in How can I?
Discussion options

You must be logged in to vote

@fruktiz32 Hello, Thank you for your interest in AutoConnect.
ACSelect retains the provided values as choice strings by a slightly different implementation than other AutoConnectElements. It saves the choice strings as an array with std::vector<String>, so the sketch cannot directly access the value member to get a determined string.
Use the value() function to get the string selected in ACSelect. So change your code to:

Serial.println(curr.value());

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fruktiz32
Comment options

Answer selected by Hieromon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants