Counter combined with angle to digital convertor