This program displays a button on the Show page and displays the number of times it has been pressed in real time. It runs a task called b_press each time the button is pressed.
Button Task Program
print "Button Task Program Start"
-- Set button to run b_press task when pressed.
pb c c ^p=b_press^n=Run Task^
-- main program loop
ptl c d "Button Presses /count"