How do I convert a 3-axis quaternion to a 1-axis x-y axis plane?

I have been working with the chip parallel to the ground which is working. When I put the pcb in my toy I realized I'm back to the quesion in my original post, which was ...

My 6050 chip is on a pcb board that is tilted. So the Z-axis of my sensor is at an angle. I need to convert the quaternion given by the tilted 6050 into a simple single-number yaw. I need the yaw relative to my toy not my 6050 chip.

How do I do this?