Adding compass functions, initialization occurs and an initial value is loaded into the float variable heading, but it is not updated. This can be accomplished by adding: heading = getHeading(); to the loop where necessary.