In addition to sending human readable text messages over your Arduino’s serial communications you can also send and plot numeric data. In this very short tutorial we’ll learn to leverage this and use our Arduino to plot
We can open the serial plotter via the Arduino context menu under
Tools -> Serial Plotter. The serial plotter expects numeric values to be printed to the serial monitor seperated by new lines. For example, if we wrote a program to print
to the serial monitor the serial plotter would plot
y = x + 1 on the screen.
For our example let’s plot
sin(x). The code to do this is quite straightforward so I’ll just reproduce it below:
If you upload this to your Arduino and open the serial plotter you’ll see
sin(x) being plotted on the screen.
loop() function being run?