Almost every startup has gloomy periods, and often more than one. The patent is a really bad signal IMHO (I did this once). It's great that you value your relationship, and you should try to keep it that way if you can. They will need some help transitioning you out of the company, and so you should give them more than the usual 2 weeks notice IMHO. I gave 3 months notice once. Best of luck