This post is a continuation and modified version of an [earlier post][1] from few years ago.  

Please help with the Dynamic  function capturing data from a Serial stream from Arduino. I am not having luck with Dynamic capture of data from an Arduino serial port.  Here is my code

    dev = DeviceOpen["Serial", "COM3"]
    
    parseData[{val1__, 44, val2__, 44, val3__}] := 
     ToExpression@FromCharacterCode@# & /@ {{val1}, {val2}, {val3}}
    parseData[___] := Sequence[]
    
    rawReadings = {}
    
    task = SessionSubmit[
      ScheduledTask[
       AppendTo[rawReadings, 
        DeviceReadBuffer[dev, "ReadTerminator" -> 10]], {1, 100}, 
       "AutoRemove" -> true]]
    
    rawReadings
    
    test1 = parseData /@ rawReadings
    
    ListLinePlot[Transpose[parseData /@ rawReadings], 
      PlotLegends -> Automatic] // Dynamic
    
    DeviceClose[dev]

The Arduino sketch sends a group of 3 integers separated by a *coma* (ASCii 44) . Sometimes when loading, the buffer does  send all 3 pairs and carriage return (ASCII 10). But not sure if this is the problem. 

So far, the code  plots 3 or maybe 4 sets , then stops. I like to Dynamic plotting of the data stream from Arduino

The code of the Arduino sketch is below. It is a modification of the original to print 3 sensor readings.


    #include <Wire.h>
    #include "Adafruit_AS726x.h"
    
    //create the object
    Adafruit_AS726x ams;
    
    //buffer para leer valores en bruto  
    uint16_t sensorValues[AS726x_NUM_CHANNELS];
    
    //buffer para  guardar los valores calibrados( no esta siendo utilizado en este codigo)
    //float calibratedValues[AS726x_NUM_CHANNELS];
    
    void setup() {
      Serial.begin(9600);
      while(!Serial);
      
      // inicializa el pin digital LED_BUILTIN como un output.
      pinMode(LED_BUILTIN, OUTPUT);
      
      //inicia y permite la comunicacion con el sensor 
      if(!ams.begin()){
        Serial.println("could not connect to sensor! Please check your wiring.");
        while(1);
      }
    }
    
    void loop() {
    
      //lee la temperatura del sensor
      uint8_t temp = ams.readTemperature();
      
      //ams.drvOn(); // descomentar esto si quieres usar el led del sensor para hacer medidas
      ams.startMeasurement(); //begin a measurement
      
      //permite que el sensor lea la data cuando este disponible 
      bool rdy = false;
      while(!rdy){
        delay(1000);
        rdy = ams.dataReady();
      }
      //ams.drvOff(); //descomentar esto si quieres usar el led del sensor para hacer medidas
    
      //lee los valores!
      ams.readRawValues(sensorValues);
      //ams.readCalibratedValues(calibratedValues);
    
       //Serial.print("{");
      //Serial.print("Temp: "); 
      //Serial.print(temp);
      //Serial.print(",");
      //Serial.print(" Violet: ");
      //Serial.print(sensorValues[AS726x_VIOLET]);
       //Serial.print(",");
      //Serial.print(" Blue: "); 
      Serial.print(sensorValues[AS726x_BLUE]);
       Serial.print(",");
      //Serial.print(" Green: "); 
      //Serial.print(sensorValues[AS726x_GREEN]);
       //Serial.print(",");
      //Serial.print(" Yellow: ");
       Serial.print(sensorValues[AS726x_YELLOW]);
        Serial.print(",");
      //Serial.print(" Orange: ");
      //Serial.print(sensorValues[AS726x_ORANGE]);
       //Serial.print(",");
      //Serial.print(" Red: "); 
      Serial.print(sensorValues[AS726x_RED]);
      //Serial.print("}");
       
      Serial.println();
      //Serial.println();
      
    delay(400);
    }




Here my results[![enter image description here][2]][2]


  [1]: https://mathematica.stackexchange.com/questions/189884/plot-serial-data-from-arduino-with-time-date-problem?fbclid=IwAR3N99knSOBMhQ91pbKTL2z_zXvqXHiaW_tUrzlZW9sxIgrqzvd15LJM1bk
  [2]: https://i.sstatic.net/prQR8.png