Flight Crew Instrument; Flight Crew Private
Flight Crew Last 90 Days 11; Flight Crew Total 1830; Flight Crew Type 1138
Training / Qualification; Situational Awareness; Human-Machine Interface; Confusion; Troubleshooting
Conflict Airborne Conflict; Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Published Material / Policy; Deviation / Discrepancy - Procedural Clearance
Air Traffic Control Issued Advisory / Alert; Air Traffic Control Issued New Clearance; Air Traffic Control Separated Traffic; Flight Crew Requested ATC Assistance / Clarification
Human Factors
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.
PA-28 pilot reported they were not complying with ATC assigned headings because they had not set their heading indicator properly before takeoff.