How to make a compass like the app in iphone. The 'n' 'e' 's' 'w' are always keep upright

Thanks for the information. I’ll keep working on it.