working analog trigger with encoder counter