Flight Crew Air Transport Pilot (ATP)
Human-Machine Interface; Fatigue; Communication Breakdown; Time Pressure
Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Clearance; Deviation / Discrepancy - Procedural Published Material / Policy
Air Traffic Control Provided Assistance; Flight Crew Overcame Equipment Problem; Flight Crew Became Reoriented; Flight Crew Returned To Clearance
Human Factors
I rushed the take off by adding power before the First Officer could put the heading into the autopilot. The light aircraft (repositioning flight) caused us to climb faster and only added to the stress of the situation. Lastly the 26 hour delay and 5 hour sleep period because our hotel was an hour away did not help the situation.The original departure was scheduled for the day before but with ground stops totaling more than 7 hours we were told at midnight that the flight would be delayed till the next morning. The only hotels scheduling could find were near ZZZ so after much transportation issues our ride arrived 3 hours later and we arrived at our layover hotel at 4:15 am.The next morning we woke up to transportation issues again and made it to the gate around 1:30pm. As the crew and I began our preflight duties; the first class flight attendant noticed the emergency lights had been turned on after we left by the cleaning crew. The emergency battery packs were now dead and the maintenance delay pushed us until 6pm.When the logbook had been signed off; I began looking for our gate agent and not finding a [company] representative until I started making my way to the ticket counter and found a new agent coming on shift prior to exiting security.She helped push us out but as we closed the door she and the Ramp Agents left until we could find a crew 30 minutes later. 26 hours later; our flight from the day before was on its way as a repositioning flight to ZZZ1.I was the pilot flying and as we were cleared for takeoff; Tower gave us a heading to fly of 090 degrees. The First Officer was the pilot monitoring and as the clearance was given I began applying power while he spun the heading knob. He had difficulty with the knob and began asking me what was the heading. As we lifted off and I called for speed and flap commands; the First Officer was behind the airplane so I decided turning the autopilot on would be wise. And in the fatigue of the day I said put it on the heading of 040 they assigned us.Tower sent us over to departure and the First Officer checked in without our heading to which I asked him to tell them our heading. Departure turned us to the 090 heading and queried our recent heading saying there was no traffic conflict but know for next time it was heading us toward ZZZ departures. The controller said there is nothing we need from y'all; you are ok but just make sure next time the heading assigned is flown or if it is heading north east toward ZZZ query the clearance.Next time and every flight to come I will be sure a new heading or altitude assigned while also given the takeoff clearance is put into the autopilot before power is added.
Air carrier Captain reported that time pressure; fatigue; and poor crew coordination resulted in a navigation error on departure.