Printing a series of sensor values and efficiency
so i've read serial.print inefficient cpu wise.
take section of code interrupt service routine:
sensora = analogread(sensorpina);
sensorb = analogread(sensorpinb);
sensorc = analogread(sensorpinc);
sensord = analogread(sensorpind);
serial.print(sensora);
serial.print(", ");
serial.print(sensorb);
serial.print(", ");
serial.print(sensorc);
serial.print(", ");
serial.println(sensord);
will give me result this: 513, 518, 507, 467
now i'm planning on having these sensors read @ 1 or 10khz rate , print out values. because of inefficiency of serial.print function wondering how streamline this.
serial.println(sensora","sensorb","sensorc","sensord);
this doesn't work. wondering how efficiently print out 4 sensor values comma between them can process data later in excel?
take section of code interrupt service routine:
sensora = analogread(sensorpina);
sensorb = analogread(sensorpinb);
sensorc = analogread(sensorpinc);
sensord = analogread(sensorpind);
serial.print(sensora);
serial.print(", ");
serial.print(sensorb);
serial.print(", ");
serial.print(sensorc);
serial.print(", ");
serial.println(sensord);
will give me result this: 513, 518, 507, 467
now i'm planning on having these sensors read @ 1 or 10khz rate , print out values. because of inefficiency of serial.print function wondering how streamline this.
serial.println(sensora","sensorb","sensorc","sensord);
this doesn't work. wondering how efficiently print out 4 sensor values comma between them can process data later in excel?
the problem using serial.print(ln) in isr isn't serial.print(ln) functions inefficient. serial.print(ln) slow.
the additional time required make multiple function calls minuscule compared time required serial.print(ln) data.
attempts combine data single call serial.println in isr required not affect time required execute isr.
the additional time required make multiple function calls minuscule compared time required serial.print(ln) data.
attempts combine data single call serial.println in isr required not affect time required execute isr.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Printing a series of sensor values and efficiency
arduino
Comments
Post a Comment