Inertial sensor no more proccesses error


I am running into an issue with my inertial sensor. I spent about 2 hours debugging and here’s what I have discovered:

first, this is the code that causes the problem:

	while( pitch != infinity())
		pros::lcd::set_text(6, strerror(errno));
		pitch = inertialSensor.get_pitch();
		pros::lcd::set_text(3, "pitch: " + to_string(pitch));
		pros::lcd::set_text(4, "num pitch sensor loops: " + to_string(count));
		pros::lcd::set_text(7, strerror(errno));

This produces the following error in errno: no more processes

I have tried removing each line individually and reordering the lines as well. When I have the get_pitch function and the delay function in the same loop, it only takes one loop to trigger the error. If I remove the delay function, the code makes it through 5 loops before throwing the error. I also tried this by removing the loop and copying and pasting the internal code several times and it still exhibits the same behavior.

I have also tried this using the original declaration of the inertial sensor as well as a pointer to it, and the results are the same. In addition to that I ran it before and after a call to reset, but that didn’t change anything either.

I am thinking about reporting this as a bug to the pros folks, but if any of you have any ideas about something that I’m doing wrong or good workarounds for the problem, I would appreciate it.