i kinda solved it with this code:
- void serialEvent(Serial port) {
- measure = commPort.readStringUntil('\n');
- if (measure != null) {
- String[] valori_misura = new String[5];
- valori_misura = split(measure, ",");
- ps_voltage = parseFloat(valori_misura[0].trim());
- c_voltage = parseFloat(valori_misura[1].trim());
- current = parseFloat(valori_misura[2].trim());
- ps_time = parseInt(valori_misura[3].trim());
- c_time = parseInt(valori_misura[4].trim());
- PS_VOLTAGE = append(PS_VOLTAGE, ps_voltage);
- C_VOLTAGE = append(C_VOLTAGE, c_voltage);
- CURRENT = append(CURRENT, current);
- PS_TIME = append(PS_TIME, ps_time);
- C_TIME = append(C_TIME, c_time);
- }}