Sample ID in text box
Posted: 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);
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);