Hi all,
My self-taught knowledge of PICs has left me wondering about something I've just encountered. I have a PIC reading an analog voltage from 0-5V. This voltage determines the output duty cycle of a PWM waveform, but it also determines the flash rate of LEDs connected through a resistor to the MCU.
What I'm wondering is this: How do I do both "at the same time"? I know that's not entirely possible, but let's consider an example.
Say I wanted to flash one LED once per second if the voltage at the ADC goes above 1 VDC. As the voltage increases, I want to increase the PWM duty cycle, but if I'm using delays to flash the LED, the sampling rate of my ADC goes way down, right? How would I go about accomplishing both objectives?
As usual, I'm not looking for code, I can do that myself. I just need a friendly push in the right direction
My self-taught knowledge of PICs has left me wondering about something I've just encountered. I have a PIC reading an analog voltage from 0-5V. This voltage determines the output duty cycle of a PWM waveform, but it also determines the flash rate of LEDs connected through a resistor to the MCU.
What I'm wondering is this: How do I do both "at the same time"? I know that's not entirely possible, but let's consider an example.
Say I wanted to flash one LED once per second if the voltage at the ADC goes above 1 VDC. As the voltage increases, I want to increase the PWM duty cycle, but if I'm using delays to flash the LED, the sampling rate of my ADC goes way down, right? How would I go about accomplishing both objectives?
As usual, I'm not looking for code, I can do that myself. I just need a friendly push in the right direction