Push Button State Change (Multiple Conditions)

if mreading is not the same as lastmachineState then you reset your debounce time so your very next if() statement will never be true AND you never update lastmachineState