Light Sensor Help(Vex Code

How do you get the brain to print out the light sensors’ analog values? Currently, the syntax is incorrect and no API has the correct one. If you have any questions about my problem please ask.

void temp(){
Brain.Screen.render();
Brain.Screen.print(LightA.value(analogUnits));
sleep(5);

    }

I believe that you would just do this:

void temp(void){
   Brain.Screen.setCursor(xvalueofcursor, yvalue of cursor);
   Brain.Screen.setFont(whatever font size you want);
   Brain.Screen.print(LightA.value(analogUnits));
   sleep(5);
}
1 Like

What do u mean by x and y value of cursor?

Also the analogUnits part is the one that is errored so that needs to be changed i just dont know what to.

That would just be where you want the cursor to start on the screen.
for your second question, basically its asking for what unit you want. In this case use;

Brain.Screen.print(LightA.value(percent));

If that doesn’t work, use pct instead of percent.
You can also find info on how to use functions in the VEXcode API:

https://api.vexcode.cloud/v5/html/index.html

1 Like

The number is showing on the far right of the screen. How do I combat this?

Make your x value less than what it already is. Alternatively, just set your cursor like below:

Brain.Screen.setCursor(24,6);
1 Like