I've got a neat project I'm working on and I have a little snag that I can't seem to figure out on my own.
I'm using a parallax Ping))) to control the brightness of an LED (for now) and I've gotten the LED to brighten based on how close you are to the Ping))) but I want to smooth the output of the ledPin.
I am getting confused because I am using a 1 millisecond delay to control the Ping)))'s sensor value and I can't seem to figure out how to use the "smooth signal" or "fade LED" tutorials to achieve a smooth increase and decrease of LED brightness rather than the instantaneous LED reflection of the Ping)))'s measurements.
basically I don't want the LED to reflect the Ping)))'s distance measurement instantly, but instead fade from one value to the next.
taking distance readings at a rate of once a millisecond makes it difficult to see the effects of a fade but all that I'm really trying to avoid is the LED shooting between two dramatically readings ie: when the distance shoots from 3cm - 300cm.
so I've been trying to figure out some sort of debounce modification that incorporates analogWrite fading so that when ever there is a large enough jump in distance there is a fade to protect from ugly blinking.
so far my attempts have not been very fruitful.
I'd really like to know if what I'm proposing is possible, and if so how to achieve this effect.
thanks - IMUR