So have you had a new battery put in yet??? Engine management light will come up if the battery is getting weak.
Start with the basics first before panicking, if may not be a major at all. Please explain exactly what it's doing.
If you haven't already had a new battery put in, it may pay too, one thing eliminated. Hopefully it's not still on it's original battery???
Also use the search function on here and put on "pedal dance". This is the manual procedure for you to find error codes yourself.