Codeine and anxiety...

Has anyone with anxiety ever taken codeine? Last night I took 5 (30mg) tablets of codeine 3 and got really high off it. After awhile I started getting really anxious and scared, and couldn't sleep (this was at like 6am) so I found meds I used to be on for anxiety (since I'm waiting for the doctor to prescribe me something else) and took one.
It knocked me out within about 15 mins, but then I had the most intense scary dreams and kept having sleep paralysis. I just woke up about half an hour ago (it's about 8:30am now) and I'm still pretty fucked and my heart is racing.
I know it was a dumb thing to do, but does anyone know if codeine is bad for causing or increasing anxiety?