Help to use Canvas to count Double-Touch, blocks look right but not working

I can't see what I'm doing wrong, see below blocks.

I'm trying to learn to use the Canvas to count screen touches, to ultimately use BrightnessTools to toggle screen brightness from 60% to 0, and to 0 and 60% when double-touched.

doubleTap1

Any advice appreciated

If you mean your tap count to alternately rise and fall in a saw tooth wave, you would need an extra global variable to remember the direction (rise/fall) and change your limit tests to < and > against your upper and lower limits to decide when to switch direction.

I am not sure what you mean by double touch.
Two fingers simultaneously (needs an extension), or
One after another?

By double-touch I mean Double-Tap, like is used to wake-up/sleep a newer Samsung Galaxy A or S series phone. 2 separate Taps with one finger.

Sorry for the mixed terminology. I searched double-tap of screen using extensions and most results referred to 'double-touch'.

If you want to test for two taps within a given interval, keep a global variable with the last Clock1.SystemTime of a tap.

When tapped, check current Clock1.SystemTime against the global.
If the difference is small enough, you have a double tap.