Disconnect your battery for at least 30 minutes, get some fuel in the tank and then see how it runs and if you're still throwing code. Rough running indicates an issue with fuel or ignition, so you should be able to limp it a short distance if you need to. Likely you've got either a failed sensor or loose/bad connection to one. The ECU controls fuel and ignition based on what the various sensors are telling it, so if it gets incorrect information it will run rough. Don't start swapping parts until you know what the issue is as you'll likely exaggerate the issue and not really know what the cause is.
This doesn't sound like anything serious, you'll just have your patience tried tracking the fault down. A decent OBDII code reader is a must-have for anyone owning an equipped vehicle and planning on keeping their wallets safe from the stealership.![]()