0

Vex ROBOTC has the following command for displaying integers to the LCD display: displayLCDNumber(nLine, nPos, nValue, nPrecision);

I'm trying to display the following: displayLCDNumber(0, 4, (float) 3.14159, nPrecision);

Supposedly, using the nPrecision parameter I should be able to display floats. Unfortunately, I cannot seem to get this to work. When I specify a negative integer, it just adds leading 0s to the displayed numbers. When I specify positive, it just shifts the integer portion of my number that many places right. When I try decimal nPrecisons such as 0.6, it does nothing. What is the nPrecision parameter and what do I need to set it too to correctly display my number?

API here: http://www.robotc.net/wikiarchive/VEX2_Functions_Display

Edit: Any help would be apreciated, preferably as soon as possible because I will only get a chance to test/use it tomorrow and friday for like 30 minutes.

Ashwin Gupta
  • 2,159
  • 9
  • 30
  • 60
  • Make sure that you're actually passing a float in, please. Implicit casting can be a b-- er, big problem. – Nic Apr 21 '16 at 02:56
  • @QPaysTaxes yeah tried that, you mean like `(float) 3.14158` as the parameter for nValue right? – Ashwin Gupta Apr 21 '16 at 03:00
  • Also that the function takes a float and not an int. I know nothing about RobotC, so this may be totally irrelevant. – Nic Apr 21 '16 at 03:01

0 Answers0