rem FunctionPins.basremrem last revision 14 Aug 2002remrem shows how LOCK, HOLD and CAPTURE pins can be usedrem either as switches or as simple buttons.remrem TEST pin cannnot be used as it will always reset therem meter together with the macro.remrem LOCK, HOLD and TEST pins always perform additionalrem actions which can be selected in CODE9// in this macro we will use:// - HOLD as a button to show a message// - LOCK as a button to switch between CH3 and CH2 display// - CAPTURE as a START/STOP switch,BIT|SHOW_MSG=|HOLD_PINBIT|SWITCH_DISPLAY=|LOCK_PINBIT|START=|CAPTURE_PINReset_Macro:// set both HOLD and LOCK to 'clear tare'// to omit interference with this particular macro&CODE9=0055CONSTBUTTONS_OFF=0CONSTSHOW_MSG=1CONSTSWITCH_DISPLAY=2#buttons=BUTTONS_OFFCONSTCOUNT_TIMEOUT=10&DATA_SOURCE_DISPLAY1=addr(&CH3)&CH3=300&CH2=200endMain_Macro:if|SHOW_MSG=onthen#buttons=SHOW_MSGelsif#buttons=SHOW_MSGthen#buttons=BUTTONS_OFFgosubshow_messageendifif|SWITCH_DISPLAY=onthen#buttons=SWITCH_DISPLAYelsif#buttons=SWITCH_DISPLAYthen#buttons=BUTTONS_OFFgosubswitch_displayendifif|START=onthen// run the application: increment &CH3if&TIMER1>=COUNT_TIMEOUTthen&CH3=&CH3+1&TIMER1=0endifelse// stop the application: reset TIMER1, don't increment &CH3&TIMER1=0endifendshow_message:write""write" you pressed the show message button "returnswitch_display:if&DATA_SOURCE_DISPLAY1=addr(&CH3)then&DATA_SOURCE_DISPLAY1=addr(&CH2)else&DATA_SOURCE_DISPLAY1=addr(&CH3)endifreturn