Proton BASIC Compiler - How To... PPRINT tip's and tricks 1


  • PicŪ Basic


  • How To... PPRINT tips and tricks 1

    by Tim Box

    Explanation

    Pprint offer great flexibility, and improves the appearance of a GLCD no end. The fonts though can take a lot of code space, which might be very wasteful when you really only want to display large numbers.

    The trick is to reduce the font to hold just the characters you require.

    This is how to store only the numbers from a font, Chrs48 to Chrs57 / 0 to 9

    Open the font file and remove all CDATA from character " " to "/", but leaving the labels in place. Next remove all the labels and data from ":" onwards. Lastly remove all the labels from the look up table, label 57 onwards.

    Note. you have to leave the labels before "0" to enable the correct character data to be addressed.

    The same technique can be used to store only the characters you use no matter what they are or in what sequence. But remember to save the label names unless they are after the last character you want to use.

    Code:
    '
    ' FONT information for  Arial  - Font Size 16 (Point Size 12) Bold 
    '---------------------------------------------------------------------------------------------------'
    '
    '
    ' Pointers to the actual font table
    '
    Arial_B__12:-
    
    Cdata     word 16 ' Font is 16 High
    
    Cdata      Arial_B__12_0,Arial_B__12_1,Arial_B__12_2,Arial_B__12_3,Arial_B__12_4,Arial_B__12_5,_
               Arial_B__12_6,Arial_B__12_7,Arial_B__12_8,Arial_B__12_9,Arial_B__12_10,_
               Arial_B__12_11,Arial_B__12_12,Arial_B__12_13,Arial_B__12_14,Arial_B__12_15,_
               Arial_B__12_16,Arial_B__12_17,Arial_B__12_18,Arial_B__12_19,Arial_B__12_20,_
               Arial_B__12_21,Arial_B__12_22,Arial_B__12_23,Arial_B__12_24,Arial_B__12_25
              
    ' Font data
    
    Arial_B__12_0:-  
    Arial_B__12_1:-  
    Arial_B__12_2:-  
    Arial_B__12_3:-  
    Arial_B__12_4:-  
    Arial_B__12_5:- 
    Arial_B__12_6:-  
    Arial_B__12_7:-  
    Arial_B__12_8:-
    Arial_B__12_9:-  
    Arial_B__12_10:- 
    Arial_B__12_11:-
    Arial_B__12_12:- 
    Arial_B__12_13:-  
    Arial_B__12_14:- 
    Arial_B__12_15:-  
    Arial_B__12_16:-
    CDATA 9,240,3,252,15,14,28,6,24,6,24,14,28,252,15,240,3,0,0 ' Code for  char 0  
    Arial_B__12_17:-
    CDATA 6,48,0,24,0,12,0,254,31,254,31,0,0 ' Code for char 1  
    Arial_B__12_18:-
    CDATA 9,24,24,28,28,14,30,6,27,134,27,198,25,252,24,56,24,0,0 ' Code for  char 2  
    Arial_B__12_19:-
    CDATA 9,8,6,12,14,6,28,102,24,102,24,230,28,252,15,156,7,0,0 ' Code for  char 3  
    Arial_B__12_20:-
    CDATA 9,0,7,128,7,224,6,112,6,28,6,254,31,254,31,0,6,0,0 ' Code for char  4  
    Arial_B__12_21:-
    CDATA 9,224,6,254,14,110,28,102,24,102,24,230,28,198,15,128,7,0,0 ' Code  for char 5  
    Arial_B__12_22:-
    CDATA 9,240,3,252,15,204,28,102,24,102,24,230,28,206,15,140,7,0,0 ' Code  for char 6  
    Arial_B__12_23:-
    CDATA 9,6,0,6,0,6,30,198,31,246,1,62,0,14,0,6,0,0,0 ' Code for char 7  
    Arial_B__12_24:-
    CDATA 9,56,7,252,15,198,24,198,24,198,24,198,24,252,15,56,7,0,0 ' Code  for char 8  
    Arial_B__12_25:-
    CDATA 9,120,12,252,28,206,25,134,25,134,25,206,12,252,15,240,3,0,0 '  Code for char 9
  • Recent Activity

    david-48000

    Valid time in NMEA sentance

    Thread Starter: SimonJA

    Is there any way to know that a GPS nmea sentence has the correct time? I use a module to keep a pic rtc accurate but have noticed that when...

    david Yesterday, 20:40 Go to last post
    towlerg-21522

    I'm over the moon with joy. :-)

    Thread Starter: Les

    I just had to show you this, because I am over the moon with it. LOL I've just about finished procedures on the Proton 8-bit compiler so I am busy...

    towlerg Yesterday, 16:13 Go to last post
    david-48000

    GPS speed logger for RC planes.

    Thread Starter: david

    Hi All, This is a simple project to allow the logging of RC plane speeds to help determine battery, motor and prop variables. The code is crude and...

    david Yesterday, 21:01 Go to last post