AnsweredAssumed Answered

Hysteresis Code - C/C++

Question asked by brian cavanagh on Mar 7, 2018
Latest reply on Mar 11, 2018 by xiangjun.rong

Hi, in my design I'm charging a battery using a USB connection.  

I'm using the MK22FN256VLH12 uC in my project.


I will attach my code that I wrote.  I'm adding Hysteresis so the LED doesn't blink both Green and Red at the same time when I'm at the threshold from Charged / Not Charged.  I'm not sure if it's correct. 


Any feedback would be great.