ArduCopter: how to get heading in Simple/Super Simple mode

I’ve connected a PIC16F over i2c and coded it to control RGB LEDs, to change colors with flight modes, and to indicate a few other things (battery failsafe, GPS status, etc). I’d like to teach it to indicate the “forward” direction of the quad in simple/super simple mode, so that whatever arm or arms is pointed forward can be a different color. All the calculations and color changes are done by the ArduPilot driver, the PIC just gets fed a 16-bit PWM value for each color on each arm. I’m not quite sure where to find this in the source code though, anyone care to give me some pointers? I’m working from ardupilot 3.4-rc2, although I’m going to rebase against master (rc4) tonight.