final arduino sketch with brightness and infrared settings