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. :)
COUNTER
- 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:
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel