Logging with V5 Vexcode Pro

Is there a recommended way to do data logging within Vexcode Pro? For example storing values during PID tuning or the like. Seems straightforward to write to the microSD card, but pulling that out after each run is slow.

Is there a way to make this directly accessible to the connected PC (wired or wirelessly)?

1 Like

You can print to the console (wireless or wired) using standard C++ or C print methods, i.e.
std::cout and printf.

4 Likes

What is the best way to redirect the console output into a file?

1 Like

The simplest way would be to write that data onto a file written on an SD card on the V5 Brain.

You may find these helpful:
https://api.vexcode.cloud/v5/html/classvex_1_1brain_1_1sdcard.html

Edit:

You can also use the standard C++ std::ofstream to write to a file onto the V5 SD Card, Which is probably an easier method in my honest opinion.

https://www.learncpp.com/cpp-tutorial/basic-file-io/
https://www.cplusplus.com/reference/fstream/ofstream/

2 Likes

We are trying to avoid pulling the SD Card after every run. Printing to the console does this, but it would be nice to pipe/redirect it to a file rather than cur and paste.