Hi, Brian,
I do not know your application clearly. But for the Hysteresis function, pls refer to the following figure, you have to define the threshold f16HystOFF and f16HystON value, when the input variable f16In is greater than f16HystON, f16OUT=f16OUTON. When the input variable f16In is less than f16HystOFF, f16OUT=f16OUTOFF. When the input variable f16In is greater than f16HystOFF and less than f16OUTOFF, f16OUT variable remains it's value.
This is the code:
if( f16In>f16HystON) f16OUT=f16OUTON;
if( f16In<f16HystOFF) f16OUT=f16OUTOFF;
it is okay.
Hope it can help you
BR
Xiangjun Rong
