- one digital input
- one digital output
There are also other circuits out there, which only
need one single GPIO. But they have the clear disadvantage
that they need to reconfigure this GPIO constantly. Additionally
you have to take care about the VRef, which you are using, as it
will be pulled to ground by the GPIO acting as an output.
You need to take care to not destroy your board with that. In the
Circuit, recommended here, it is to my understanding much safer,
as we simply use the digital output as our VRef. Therefore we can
easily and safely pull it to ground.
Digital Output (VRef)
Transistor / Poti / LDR / ...
|---> Input Pin
The accuracy of the measurement relies in some aspects on the scheduling.
So it is recommended to schedule the task, which is driving this FB, as
frequent as possible. It is generally OK to combine this FB with the SoftPWM.
Just the sampling accuracy will slightly vary, depending on the frequency
of the PWM.