(I assume this is the right forum to post this in…)
This package includes two functions and one task, among other things:
**LCD_Display: **This task displays the competition status, time spent within that status, and voltages of the main battery, power expander (if installed) and backup battery. The battery display is easily customized; see documentation.
**LCD_Prompt: **This function displays a prompt of up to 28 characters and three answer choices on the LCD and reports which one was selected. A default choice and timeout can be specified. Fully customizable; see documentation.
**LCD_Menu: **Displays complex, multi-level menus on the LCD, and allows the user to scroll through with the buttons. Useful for requesting large amounts of information from the user, such as autonomous configuration. A Sack Attack menu is included. Fully customizable; see documentation and included prebuilt menus.
Unwanted features can easily be completely removed at compile time. See the documentation for details.
This package also includes a patched Vex_Competition_Includes.c file, which does not hog the LCD and is more lightweight.
This header file uses a timer system similar to the timers.h system. Read the documentation for that header file for details.
The statistics below are with Release optimization enabled and the Sack Attack menu included. Note that removing or reducing the menu significantly reduces resource usage. See the compile statistics for details.
File "lcd_demo.c" compiled on Jul 21 2012 21:20:41
Compile Statistics: (lcd_demo.c)
0.032 Total Compile Time (seconds)
4,541 Total code bytes, (after 638 bytes removed during optimization)
392 Constant Pool Size (in bytes)
1,156 Used memory locations (of 12000), 2 Tasks, 15 Procedures
638 User Source file lines, 3,688 tokens
6,169 System Include file lines, 26,792 tokens
0 Errors, 0 Warnings, 0 Info Messages
CPU ......Lines/sec.....
Seconds Total Source
Scanner/parsing: Setup 0.003 2,097,202 196,564
Scanner/parsing: System 0.000 34,435,783 3,227,564
Scanner/parsing: User Files 0.006 1,113,670 104,380
Code Generation 0.016 426,822 40,004
Code Optimize 0.004 1,772,812 166,160
Total 0.032 210,055 19,687
121 Total symbols added to symbol table
1.083 Avg hash bucket depth (1.0 is best possible)
File "lcd_demo.c" compiled on Jul 21 2012 21:24:22
*Warning*:LCD_Menu() and related functions and variables have been excluded from this compilation.
Compile Statistics: (lcd_demo.c)
0.022 Total Compile Time (seconds)
2,756 Total code bytes, (after 425 bytes removed during optimization)
198 Constant Pool Size (in bytes)
380 Used memory locations (of 12000), 2 Tasks, 8 Procedures
470 User Source file lines, 2,673 tokens
6,169 System Include file lines, 26,792 tokens
0 Errors, 1 Warnings, 0 Info Messages
CPU ......Lines/sec.....
Seconds Total Source
Scanner/parsing: Setup 0.003 2,308,899 163,455
Scanner/parsing: System 0.000 39,361,242 2,786,531
Scanner/parsing: User Files 0.004 1,586,199 112,293
Code Generation 0.011 627,628 44,432
Code Optimize 0.002 2,875,082 203,537
Total 0.022 299,252 21,185
96 Total symbols added to symbol table
1.082 Avg hash bucket depth (1.0 is best possible)
File "lcd_demo_competition.c" compiled on Jul 21 2012 21:20:20
Compile Statistics: (lcd_demo_competition.c)
0.074 Total Compile Time (seconds)
4,857 Total code bytes, (after 735 bytes removed during optimization)
392 Constant Pool Size (in bytes)
1,160 Used memory locations (of 12000), 4 Tasks, 21 Procedures
965 User Source file lines, 4,419 tokens
6,169 System Include file lines, 26,792 tokens
0 Errors, 0 Warnings, 0 Info Messages
CPU ......Lines/sec.....
Seconds Total Source
Scanner/parsing: Setup 0.003 2,516,192 340,359
Scanner/parsing: System 0.034 209,342 28,317
Scanner/parsing: User Files 0.009 769,203 104,048
Code Generation 0.020 361,839 48,945
Code Optimize 0.004 1,754,596 237,340
Total 0.074 96,758 13,088
1,403 Total symbols added to symbol table
1.076 Avg hash bucket depth (1.0 is best possible)
I’d like to acknowledge this thread. It was very useful in the creation of this header and I recommend it to programmers of all skill levels.
You may also be interested in my other header file: Timers.h.
lcd_v0.9.zip (13.7 KB)