The Codecraft Serial Plotter is useful to display a graph of values over time.
The Codecraft "Serial Port" many contains the "plotter print" block that works with the Serial Plotter.
One to five values can be plotted.
Build this sketch ➡
(To enlarge, right click, open image in new tab)
Or, download SerialPlotter.cdc,
save to your computer, and open in Codecraft using
Files ... Open local projects
Upload it
Click the Connect button and select the device for your Grove Board (same as you use to Upload)
Click the "Serial Monitor" button
On the lower right of the Serial Monitor window, change the Baud rate to 19200.
The "plotter print" block sends text like this:
printf(7,null,null,null,null)
Click the "Serial Plotter" button
You should see a graph of the values sent by the "plotter print" block, continuously updating.
Close the Serial Plotter by clicking the "X" in the upper right.
The Arduino IDE also has a serial plotter, but not with the Codecraft "plotter print" block.
Ther Arduino IDE serial plotter expects to see text in the form:
<variable1>, <variable2>, <variable3>, ...
However, the current version of Codecraft does not have block for string operations, needed to create this output.
But, Arduino IDE sketches can easily create the needed text output for the serial plotter.
Reference: Arduino Serial Plotter: The Missing Manual
Note:
Only one serial monitor/plotter program can be connected to your Grove Kit's serial port at any time.
So, if you have clicked "Connect" in Codecraft and want to use a different serial monitor program, you'll need to click "Connect" in Codecraft and then click "Disconnect." Then, you can connect to the the Kit's serial port using another serial monitor program.