A simple pendulum, click/tap and hold to angle it as you please.
Feel free to use any part of the scripts in this in your own projects, just make sure to give credit.