Home Creators Posts Import Register Favorites Logout

Content

Did you know you can do experiments and data analysis with Pybricks? A teacher recently asked us about it, so we thought we'd share it here as well.

You can see how it works in the example above. By configuring the print block to print multiple values, you get columns of data in the output window. You can copy the data to your favorite spreadsheet editor for visualization and further analysis.

In this experiment, we used the time as the first column, which becomes the x-axis for both of the other values on the y-axis (angle and reflection).

Since you can print any value, you are not limited to logging sensor values. You could also log the results of your own calculations to verify that they give the expected output.

Tip: If you clear the output before you run your program, you can right-click and choose select all to conveniently copy everything to your spreadsheet editor.

Files

Comments

chris

Very nice use case. But correctly understood: I pull a copy from the pyBricks log file - creating a log file (e.g. *.csv) in pyBricks with remanent data storage for later retrieval is not possible? 🧐

Alexander Bell

I've looked several times before... How do you clear the output window?