Sample ID in text box

Support forum for MegunoLink
Post Reply
iaintrainer
Posts: 3
Joined: Wed Sep 27, 2023 3:37 pm

Fri May 22, 2026 4:48 pm

I would like to have a text box in the interface that the user inputs a "sample ID" into. I have my setup logging the data to a file. So when this file is created I would like to retrieve the text from the text box and then log it to the file, as the first line.

Basically something like this:
String message = "Sample: " ;
message += userInterfacePanel.GetValue(F("SampleIDTextBox"), F("Text"));
logToFile.Send( message ) ; //write sample ID to file

I suspect the problem is using String versus char array. I don't understand how the text box text is retrieved. I cannot find any examples.

I would be fine with using a command handler and storing the text each time it is revised. But I cannot get the below to work, again I'm guessing because of the String variable.
String sampleID ;
SerialCommandHandler.AddVariable(F("sampleID"), sampleID);
Thanks,
Jeff
Post Reply