I have been reading a lot of examples from these forums over the past year and learning a lot about PICS and programming using PIC BASIC so I thought I would try to contribute.

Here is a base program I use for projects that require a lot of menus to configure variables. This is just the shell but it works 'as is' for demonstration purposes. It is easily expandable too.

This code was developed on an 18F4550 using the microchip USB HID bootloader and DT_INTS. So you may have to make some changes if you are not using the bootloader.

The DT_INTS is only used to flash an led and drive some example code for two count down timers.

To build the menus I typically make a diagram like the one attached. Then code it out as in the example.

Most of my projects use 5 pushbuttons; Menu, Plus, Minus, Enter and Reset. So this example is based on those buttons.

The code is pretty well commented so I will leave out re-writing the details here.

If anyone has ideas on how to make this code smaller, run faster, etc. I would be interested.

The first time I made a program with menus like this was using assembly. It took days. With PBP it took about 20 minutes. If I get some time over the holiday I may try and write a VB program that would generate code based on a menu structure you input (that's on the wish list with many other items) to speed up making menus.

Enjoy and I look forward to some feedback.

-Tom
Name:  Menus.jpg
Views: 6985
Size:  81.7 KB
MenuCode.txt