use c to track quadrature encoding