LCD Display

Hello all, I am ITzzIKEI. I am programmer of team 950. Currently, we have a LCD Display hooked up to the back. We use it to tell our battery level. I am wondering what do you guys use it for. Thanks in advanced, as always have a nice day.

I actually started programming my LCD screen today aswell, and what I’ve gotten done today was display the battery voltage on the bottom line, and then have the top line display a menu where I can choose different autonomous routines using the buttons on the LCD screen or alternatively on the controller (when you get too lazy to bend down and press the buttons :wink: ).

I’ve also used it to show alerts/notices during autonomous, so if something goes wrong, it’s easier to debug when/where there’s a problem. For instance, I can use it when I have a PID controller timeout, and I can show some information about why it timed out, and debug from there.

Hope that helps!

Well it gave me an idea, I will try to make an if statement to output an error message if a motor gets unplugged.

Anyone got a good method for displaying voltages from the batteries on the LCD using EasyC?

I can find plenty of code for RobotC but since easyC doesn’t support strings I’m at a bit of a loss as to how to do it.

Right now it’s displaying a float value that’s huge, need to get it down to two decimals.


You can show battery voltage on easyC by using GetMainBattery(); block function and reporting that to a floating type variable (float). Then use DisplayLCDScreen(); block to choose the battery variable (float) in the variable selection box. Set the directive to %f (change %d (I think it’s d) to %f). You can add text before the %f by typing in the text box.

EasyC does support strings, the “string” type in ROBOTC is not a part of the C stdio library and is a ROBOTC extension. A string is just an array of char, most of the time you would do something like this.

// define a char array to hold a "string"
char  str[32];

// use the "string"
sprintf(str, "Hello World" );

If you want to use your LCD display to select an autonomous program using easyC, you can find sample code here:

Is there a way to tell using RobotC if a motor is unplugged? It makes sense but I’ve never heard of being able to do that.

You just responded to a 2 year old thread.