Maybe someone can help me.
I have 1 analog input that is constantly variable.
Between 95 and 650 milivolt.
This is the input, this input must be held and passed on to an output pin. If a pulse (Short voltage) comes in on another input pin, this new value must be held again until another pulse comes in.
So basically a kind of sample hold of a voltage level between 95 and 650 milivolt. At the command of another input pin (signal)
Hint: Variables are the things we use to "hold" values...
I hope you're not trying to produce 95-650mV on an output pin with analogWrite()! The precision will be very low.
what defines a pulse? will it rise to some level and quickly return to zero? do you capture the maximum value of the pulse and apply that to the output pin?
gcjr:
what defines a pulse? will it rise to some level and quickly return to zero? do you capture the maximum value of the pulse and apply that to the output pin?
no the input moves quite slowly between 95 and 650 mv. It's about being able to hold on to this value.
hold which value?
do you want to output the max, the min, the max/min over some period, just sample the value periodically and output it until the next sample instant?