Lid angle trigger

to keep state put the variables outside the function: