Welcome to JustAnswer, my name is XXXXX XXXXX I'm here to help get your problem resolved. Ask follow up questions, thanks.
It sounds like the coolant temp sensor may have failed which can cause this. You can have diagnostic codes checked for free at parts store so if it indicates anything related to coolant temp sensor then replace.
Is coolant temp accurate when code sets? Does it run rough?