Modified trigger code to take a serial input of either bright or dark