How does atmospheric pressure affect wind direction?
Direction is generally determined by pressure.
To get wind there needs to be a pressure gradient, so one side will have a higher pressure than the other. Wind will then start blowing from the high pressure to the low pressure, which should make sense.
Now since the Earth rotates it will cause the direction to change. It is like trying to walk on a carousel. This is called a Coriolis Effect. The end result is the wind travels between the high pressure and the low pressure. In the Northern Hemisphere, if you put your left hand to the low pressure the wind will be blowing at your back.
The next thing that effects direction is surface friction. This causes the wind to slow down. When the wind slows the Coriolis Effect is lessened. This causes the wind near the surface of the Earth to turn back toward the original high to low pressure. So surface wind will spiral inward toward a low pressure from a high pressure. Winds aloft will just run parallel to the pressure gradient.