added gate/trigger counter and flipflop sketch