And the problem is, that it won't toggle PWM. If I add call PWM_Enable before the loop: section, then it works but in that case PWM is always enabled which I do not want... I'd appreciate it if you could point me where the problem might be.
And the problem is, that it won't toggle PWM. If I add call PWM_Enable before the loop: section, then it works but in that case PWM is always enabled which I do not want... I'd appreciate it if you could point me where the problem might be.
I don't really see what you are trying to do, but from the small section of code you posted it looks like PWM is turned OFF almost all the time, and only ever turned ON for a few microseconds.
I don't really see what you are trying to do, but from the small section of code you posted it looks like PWM is turned OFF almost all the time, and only ever turned ON for a few microseconds.
that's correct. It's supposed to turn on PWM, then check if there is an obstacle in front of the IR transmitter and then act accordingly. But now that I think of it... the IR light "wave" might be too short to be successfully detected... I'll throw a delay in there and see what happens.