How to best fill array elements from a TFT Screen

Greetings;

I'm working on a project, which has a bunch of analog sensors, which when replaced, need to be calibrated. There are 8 int elements, which will need some data entered. Data is entered on a TFT touchscreen on which is a candy bar style keyboard (as of now 0-9, CLR and RTN)

I have the following array to fill.

struct PSensor {
  int pId; //identifies Analog Channel (min channel 5)------not in PRESSURE
  int pSamples; //number of samples to filter reading (default 1)
  int pCalZero; //sensor reading with no water column
  int pCalHigh; //sensor reading with max water column
  int hRefZero; //actual NO watercolumn height of sensor in CM (default is 0)
  int hRefHigh; //actual HIGH watercolumn height in CM (default 200)
  int unitAdjust; // adjust units to display VOLUME on screen (default 0-> bars, 1->CM, other m3))
  int maxVol; // maxVolume of tank (default 0)
};

I'm toying with two approaches:

1- 8 individual windows (with titles), and with every RTN, I jump to the next window OR
2- 1 large window, which takes all 8 elements in sequence and an additional "," or ":" button on the keyboard as a separator character.
3- is there another one?

The keyboard is operated with a switch/case routine.

I'm leaning towards #2, but due to inexperience I am a bit leary of of the parsing and conversion from characters on the screen to ints in order to fit it all into the array.

Any hints and tips are greatly appreciated. You guys have been awesome so far!

Can you honestly put all required information about all those numbers into 1 entry screen?

I'd enter single values in dedicated windows with enough descriptive text. Eventually the min/max water height and related sensor reading can be retrieved from a single window.

After input complete you can present a summary window with all parameters in tabular form and eventually allow to edit some fields. Trained users can use this window to enter all values, with descriptive text changing on entry of each field (using cursor keys...).

It's all a matter of taste, screen size and GUI skills :slight_smile:

Thanks Dr. Diettrich;

Implemented as suggested. In fact, I'm reading the analog value directly into that window. to accept, I hit return. To reject, I hit backspace and enter the value manually, overwriting the previous calibration value in a different color. works lika a charm. Turns out my conversion phobia was simply a matter of acquainting myself with atoi()...

Cheers

Wow, that sounds great :slight_smile: