Narrative:

Departed with flight following. Tower cleared me to contact approach with suggested heading of 270. I turned to 270 but saw that would take me into class B; so I turned slightly to the right while awaiting contact with approach. Shortly thereafter; I was advised to turn to heading 320 which I think I acknowledged and complied with. I was further advised to 'turn to heading 320 now' because of an incoming citation. I rechecked my heading as 320; but I do not remember how or if I verbally responded. When ATC said something to the effect of turn now or I'll send you back I realized something was off. I checked my magnetic compass and realized then that I had not set my heading indicator properly during my preflight. Once corrected I was able to properly follow ATC instructions. Basic training has always been to set heading indicator prior to taxi and then double check once on runway prior to takeoff. Corrective action on my part is obviously to do a better preflight. That said; once ATC realized I wasn't responding properly; instructions to 'turn 30 degrees right' would have resolved the issue as well.

Google
 

Original NASA ASRS Text

Title: PA-28 pilot reported they were not complying with ATC assigned headings because they had not set their heading indicator properly before takeoff.

Narrative: Departed with Flight Following. Tower cleared me to contact Approach with suggested heading of 270. I turned to 270 but saw that would take me into Class B; so I turned slightly to the right while awaiting contact with Approach. Shortly thereafter; I was advised to turn to heading 320 which I think I acknowledged and complied with. I was further advised to 'turn to heading 320 now' because of an incoming Citation. I rechecked my heading as 320; but I do not remember how or if I verbally responded. When ATC said something to the effect of turn now or I'll send you back I realized something was off. I checked my magnetic compass and realized then that I had not set my heading indicator properly during my preflight. Once corrected I was able to properly follow ATC instructions. Basic training has always been to set heading indicator prior to taxi and then double check once on runway prior to takeoff. Corrective action on my part is obviously to do a better preflight. That said; once ATC realized I wasn't responding properly; instructions to 'turn 30 degrees right' would have resolved the issue as well.

Data retrieved from NASA's ASRS site 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.