|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|
#2
|
|||||
|
|||||
|
Re: Single Channel Encoder
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.
|
|
#3
|
||||
|
||||
|
Re: Single Channel Encoder
so how would i go about finding the speed then?
|
|
#4
|
|||||
|
|||||
|
Re: Single Channel Encoder
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|