Narrative:

I departed chapel hill airport (W52) in moderate turbulence (runway 27). My intention was a VFR northbound flight. I turned to the appropriate heading during climb. After 5 mins and noticed the sun to my right which would be impossible on the north heading and checked my slaved compass and found out it was not slaved and in disagreement with the magnetic compass. I began to steer via the magnetic compass and after 15 mins had corrected the problem, however, during the process and apparently violated restr space #right-5311 west of fayetteville, nc. The remainder of the trip to nj was without incident.

Google
 

Original NASA ASRS Text

Title: A PLT OF A LIGHT ACFT PENETRATED RESTR AIRSPACE. THE PLT'S HDG INDICATOR WAS NOT SLAVED. THE ERROR WAS RECOGNIZED AND THE ACFT RETURNED TO INTENDED COURSE.

Narrative: I DEPARTED CHAPEL HILL ARPT (W52) IN MODERATE TURB (RWY 27). MY INTENTION WAS A VFR NBOUND FLT. I TURNED TO THE APPROPRIATE HDG DURING CLB. AFTER 5 MINS AND NOTICED THE SUN TO MY R WHICH WOULD BE IMPOSSIBLE ON THE N HDG AND CHKED MY SLAVED COMPASS AND FOUND OUT IT WAS NOT SLAVED AND IN DISAGREEMENT WITH THE MAGNETIC COMPASS. I BEGAN TO STEER VIA THE MAGNETIC COMPASS AND AFTER 15 MINS HAD CORRECTED THE PROB, HOWEVER, DURING THE PROCESS AND APPARENTLY VIOLATED RESTR SPACE #R-5311 W OF FAYETTEVILLE, NC. THE REMAINDER OF THE TRIP TO NJ WAS WITHOUT INCIDENT.

Data retrieved from NASA's ASRS site as of July 2007 and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.