Hello,
I have a sketch running on a Teensy 3.2 and sending data to the USB port (used in serial mode). I check the data on the Arduino IDE with the serial monitor / serial tracer.
My data are basically 12-bit ADC measurements from sliders with a bit of filtering. So I do not expect values outside the 0-4095 range.
Here's the code:
However I have much bigger values, as if most separating commas are lost at some point and most values are merged together two by two. I don't understand what causes this issue.
I have a sketch running on a Teensy 3.2 and sending data to the USB port (used in serial mode). I check the data on the Arduino IDE with the serial monitor / serial tracer.
My data are basically 12-bit ADC measurements from sliders with a bit of filtering. So I do not expect values outside the 0-4095 range.
Here's the code:
Code:
#include "MeanFilterLib.h"
int filtered[12];
int raw[12];
int inputs[] = {A9, A8, A6, A5, A4, A3, A2, A1, A10, A11, A14, A0};
#define LED_PIN 6
MeanFilter<long> meanFilter[13](200);
void setup() {
analogReadResolution(12);
Serial.begin(115200);
analogWrite(LED_PIN,1);
}
void loop() {
for (int i = 0; i < 12; i++) {
raw[i] = analogRead(inputs[i]);
filtered[i] = meanFilter[i].AddValue((long)(raw[i]));
Serial.print(raw[i]);
Serial.print(",");
Serial.print(filtered[i]);
}
Serial.println();
}
However I have much bigger values, as if most separating commas are lost at some point and most values are merged together two by two. I don't understand what causes this issue.