COUNTER

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

COUNTER

Post by wayne millard »

Can you do a count of a button press in a main routine without it being reset back to zero.

Because i have a main routine and a count subrutine. being trigged by port b7 as interupt. The problem is the i can get the counter to count then get stuck in the count routine. or i set the loop to loop on button press it counts but when it exits back to the main routine the count gets reset. :)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello

Make the count variable global. That is define the variable at the start of the program in the main variables window. Then whenever you use it it should keep its last assigned value. Make sure that there is a initialisation of the variable at the beginning of the program or you could start counting from an undetermined number.

Post Reply