Data Sheet
Proteus VSM
187
Writing Firmware
Now that we have completed the workflow through simulation let's add some functionality to the
program. We know that pressing the button switches between time display, temperature and
POT display so we can easily add another mode of operation here. Start by switching to the
VSM Studio IDE tab and opening up the main.c file (double click on the item in the project tree).
You will see near the top of the file that there are some function prototypes and an enumeration
of the modes of operation. We need to add a new function prototype for our test mode and also
add a corresponding value to the enum. You can add the following:
Next, we need to find the button switching logic in order to add our new mode of operation. The
easiest way to do this is to search for one of the other modes. Right click on the editing window
in VSM Studio, select Find from the resulting context menu and then enter MODE_POT as the
search term.