Arduino IDE 1.8.2 Tool Menu - Serial Plotter
I cannot find any information/instructions on how to use the Serial Plotter.
A search of the Tutorials provides several references, but the code shows only serial.print
Any suggestions, thanks.
Arduino IDE 1.8.2 Tool Menu - Serial Plotter
I cannot find any information/instructions on how to use the Serial Plotter.
A search of the Tutorials provides several references, but the code shows only serial.print
Any suggestions, thanks.
but the code shows only serial.print
That's because Serial.print() and/or Serial.println() ARE how you send data to the Serial Plotter app to be plotted.
Try this snippet (Menu > Tools > Serial Plotter baud rate = 250000):
float sine[256];
int i;
void setup() {
Serial.begin(250000);
for (i = 256; i >= 0; i--) {
sine[i] = 200 * (sin(i * 2 * PI / 255));
}
i = 0;
}
void loop() {
uint32_t var;
delay(5);
i = (i + 1 ) & 255; // Discard all bits above 255
Serial.print(sine[i]); // Print waveform
Serial.print(" "); // print a blanck
var = (i + 64)& 255;
Serial.print(sine[var]); // Print waveform
Serial.print(" "); // print a blanck
var = (var + 128) & 255;
Serial.println(sine[var]); // Println waveform
}