See the StateChangeDetection example. You also need a flag telling the current rotation (90° yes/no), so that you know the servo position to go when a button change is detected.
See the StateChangeDetection example. You also need a flag telling the current rotation (90° yes/no), so that you know the servo position to go when a button change is detected.