// Display a 4 digit value on the LCD using RIC-Files as source font // x,y = x and y coordinate (99,0 is right lower corner, right alingned) // Value = -9999..+9999 // d = decimals 0..3 // Make sure you have the ric-files downloaded onto your NXT void My_NumOut(char x, char y, long value, char d) { char vPos=0; // Digit pointer char dx=0; // x-offset for decimal point bool LZsupp=true; // True = Leading Zero's suppressed long Digit; // Value of the digit to be displayed dx=x-1-(d*23); // Set x-coord for decimal point x-=18; // Adjust right Allignment with one digit // Place MINUS SIGN when Value below 0 if (value<0){ value=-value; // Make value positive so it can be analyzed GraphicOut(0, y, "My_-.ric"); // Draw negate sign Left Aligned } else { GraphicOut(0, y, "My_Blank10x40.ric"); // Clear Negation } // Draw 4 digits for (vPos=1; vPos<5; vPos+=1) { LZsupp=(d+10) GraphicOut(dx, y, "My_DecDot.ric"); // Draw decimal point }