![]() |
nRF5 SDK
v13.0.0
|
Choose documentation: | nRF5 SDK | S132 SoftDevice API | S140 SoftDevice API | S212 SoftDevice API |
The QDEC Example demonstrates the use of the quadrature decoder (QDEC) peripheral.
The example uses the software quadrature encoder simulator QENC to produce input. The quadrature encoder simulator uses one channel of the GPIOTE module. The state of the encoder changes according to the sampling clock generated by the LED output.
The QDEC inputs A and B must be connected to the QENC outputs A and B, respectively. The QDEC LED output must be connected to the QENC LED input.
QENC produces a variable number of positive and negative pulses in an infinite loop. These pulses are synchronized with the bursts of clock impulses that are generated by QDEC at the LED output. The pulses are counted by QDEC operating in a REPORT mode, and the count is compared with the pulses that are generated by QENC.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\qdec
Configuration:
The example works in auto-test mode:
Test the QDEC example application by performing the following steps: