Have a look at the dozens of available examples on the internet, like (for instance) this one (scroll down for AP mode) or this one on Instructables.com
Have a look at the dozens of available examples on the internet, like (for instance) this one (scroll down for AP mode) or this one on Instructables.com