Controlling FPS camera rotation with gyroscope/accilerometer

Hey, guys! I am new here and I kind of have no idea of what I should do with this issue… I would like to set a gyroscope as the player controller in an FPS game. I would like to be able to control the camera rotation with this device. As I have figured I should make a new player controller… Can anybody help me?