Your U-Boat has an AA Gun (Anti-aircraft gun) in the back of its conning tower and can use it to damage and destroy enemy aircrafts :
It has a range of 0.5 NM and can be used only when the submarine is surfaced, using this button when the target aircraft is selected :
When the submarine rises to surface, your AA gun needs 4 seconds to be ready and can fire a burst of 5 rounds every second; you have 1000 rounds and when they are finished you can call the torpedoes transport to replenish them (only in the Full version of the game).
It can be used against all aircrafts incoming from every directions (look at the previous image, the violet circle shows your AA gun range).
Be really careful, also enemy aircrafts have guns (patrol aircrafts have also 8 depth charges) and they can be very dangerous for your hull; you can try to destroy patrol aircrafts but if you meet the fighters (launched by the aircraft carriers) it is better to dive very fast and avoid them !!
Practical example of use :
Here an enemy fighter is coming from South, we rise immediately to surface to attack it :
The AA gun is not yet ready, when we come at surface it needs 4 seconds to charge :
Now our AA gun is ready, the aircraft is select but it is outside our gun range (violet circle around our submarine) :
Now it is inside our range, we use the gun pressing its button :
We hit and destroyed it (the fighter disappeared from the map), the gun now needs 1 second to recharge :
An other fighter is incoming, our shot missed it, we retry and finally we damage it :
Usually a single burst can destroy a fighter, it this case the fighter was only damaged (its health is 65%) and is returning to its carrier.
Hint : when the option “Pause game when hit by enemy” is enabled, the game pauses when an other unit (ship or aircraft) hits your submarine and it can be boring; when I want to attack an aircraft I usually keep this option disabled, I select the aircraft on the map and I press repeatedly the AA gun button until the aircraft is destroyed !