Dont drive with a flashing check engine light if at all possible, get it to a safe place to park it and do some diagnostics - closest auto parts store or mechanic garage.
First step - check battery voltage with engine off - below 12.0 is a low/bad battery, 12.6 v would be fully charged. Then, check battery voltage with engine on - should be above 13.0, below 13.0 indicated alternator not charging.
Get engine codes scanned at an auto parts store if you dont have access to a scanner. The flashing check engine usually indicates a bad continuous misfire. The check engine code will tell then tale.