Displaying IME Values on the LCD in ConVEX

I feel like this is a stupid question, and it must be out there in the documentation or on the forums somewhere. But, I can’t seem to find it.

How do you print IME values to the LCD like it does with the gyro values?


vexLcdPrintf( VEX_LCD_DISPLAY_1, VEX_LCD_LINE_1, "%4.2fV G %6.2f", vexSpiGetMainBattery() / 1000.0, vexGyroGet()/10.0 );

To show the value of the first IME

vexLcdPrintf( VEX_LCD_DISPLAY_1, VEX_LCD_LINE_1, "%d", vexImeGetCount( kImeChannel_1 ) );

If you knew that the IME was attached to a motor (and correctly configured), say motor 3, you could also use.


vexLcdPrintf( VEX_LCD_DISPLAY_1, VEX_LCD_LINE_1, "%d",vexMotorPositionGet( kVexMotor_3 ));

See the file osrlcd.c in the demo project “TestProject-OSR” for lots of examples of using the lcd.

Thank you

Also, how would you recommend resetting the gyro value? I assume reinitializing the gyro isn’t the best way to do it, but I don’t see any other gyro functions.

There really is no way to reset the gyro with the code I included in ConVEX, it was just a quick hack and is not part of the core functionality. I would make a copy of the gyro code and include a global or something to cause the bias to be recalculated and the value set back to zero. I can throw something together for you (ie. update the existing code) next week if I have time, it won’t take long.

That would be great. It was also suggested that I just use a few variables and create an offset to the current gyro value.