Robotc while loop code#
This block of code is inside the while loop I’m using to create my PID function, so that each time through the loop, it adds another row to the data with the current iteration’s values. To make it work, these calls have to be sandwiched in between a “start” and an “end” instruction, like so, with one “add” statement for each variable you want to track: datalogDataGroupStart() ĭatalogAddValue( 4, SensorValue ) The datalogAddValue() function does just what it says: it adds data to the output listing.
Robotc while loop plus#
(There’s also datalogAddValueWithTimeStamp, which does the same thing with - duh - a time stamp, plus a few others I have not used.) So far I’ve only used the datalogAddValue function, which I’ll talk about here. There are not that many items to choose from. The RobotC functions for the datalog can be found in the left-hand column of the help page above. The datalog feature only works if you add code to your program to tell it to keep track of the stuff you want. Instead, as shown in the screenshot below, you’ll want to navigate to Command Library – VEX Cortex > ROBOTC > Datalogging. This is NOT the place to find datalog information (thanks a lot, RobotC). The confusing part of finding this datalog information is not done yet from the main help page, in the left-hand column is a table of contents, and one of the items at the top level of navigation says “ROBOTC Debugger”.
Robotc while loop full#
I include the full path here instead of embedding the link because RobotC has various different wiki/help sections, and as shown in the URL, this one is specifically for VEX. So, start here on the RobotC help page for VEX. One thing that has prompted me to write this post is that I find the RobotC datalog documentation difficult to locate via Googling, so I wanted to make finding it easier for everyone else. The Help Page’s Secret Hiding Place Revealed
![robotc while loop robotc while loop](https://s1.manualzz.com/store/data/001431590_1-753a80f86be1acbdc4332ad25969191f.png)
![robotc while loop robotc while loop](https://i.ytimg.com/vi/qn8ZRhQjENA/maxresdefault.jpg)
The way I’ve been using it so far is to track data during the execution of a while loop. Since I’ve been using this for like a week, I’m sure I have only scratched the surface of what it’s capable of. RobotC’s datalog feature allows you to track up to 8 pieces of data (variables, sensor values, etc.) as the program executes, with super-easy, one-click exporting to a CSV file and automated, customizable graphs. With eas圜, you’re limited to either making good use of the LCD screen or having your robot tethered to your computer and doing a lot of print-to-screens, which zoom by at a million miles an hour, with data that’s really hard to get into a spreadsheet afterward. So what is the datalog? In short, it’s print-to-screen on steroids in the most helpful way.
![robotc while loop robotc while loop](https://www.proprofs.com/quiz-school/upload/yuiupload/1970654185.jpg)
The datalog is one of the multitude of benefits I’m experiencing with RobotC over eas圜, which we have used up to this season. Thanks once again to the coaches on the VEX World Coaches Association Facebook group for guiding me along here.
![robotc while loop robotc while loop](https://images.slideplayer.com/27/9252948/slides/slide_4.jpg)
? This week I learned about RobotC’s datalog functionality. When I learn something new, all you readers get to learn it too.