Re: Bumpless Transfer PIC18F
looks like a pretty classic state machine solution would be in order
enum state [idle, beginning, held , releasing]; button states
process each incoming val according to present state
while state idle: full pass val
transition --> to beginning, redux = 80 ,pass val-redux, transition --> state to held ; [button pressed detected]
while state held: pass val-redux , redux += 80 until redux=val ; [button held]
transition --> to releasing ,redux -= 80 ; pass val-redux, [button release detected]
while state releasing: pass val-redux , redux -= 80 , until redux=0 ,transition --> state to idle
Warning I'm not a teacher
Bookmarks