Single Channel Encoder

i was wondering if anyone has an example how to code a single channel encoder. This is for are shooter wheel so we do not need direction and we would like to save the DIO for other sensors

For our purposes, “encoder” almost always means “quadrature encoder” which requires two channels. For a single channel digital sensor, open it as a simple counter.

so how would i go about finding the speed then?

Compute the speed as the number of counts divided by the amount of time. You can read both the current count and the current time. Do that periodically, subtract the previous values from the new values, and divide the differences to yield a rate of counts per time.