Freeze Display at horizontal position

hi everyone. I am working on a project where I need to freeze/pause the displayomn the OLED if the arm of the platform is horizontal. Due to space constraints I can not use an acceleromete hence am using a tilt switch SW 520D. The sensor needs to be small and just give a high or low value at 180 degrees only. I am using an arduino nano as the microcontroler on the platform say at a distance of 4-5 inches.The tilt switch is mounted at the tip of the rod ( please refer to the attached diagram) .

Read the position of the base plate in X,Y,Z axis when the rod is horizontal to the floor. I have the arduino with a IMU and OLED screen which displays the position of the base plate . I want to freeze the display when the rod becomes horizontal to the floor . I want to use the tilt switch as a switch which causes the display showing the position of the platform(C) to freeze when the rod is horizontal. something like a push button .
I need help regarding what is the code for freezing the display, and also how can I use the tilt swit

Tilt Measuring diagram.JPG

give a high or low value at 180 degrees only.

Randomly?

There is NO device which will output a signal only when it is at 180.000000000000000000000 degrees.

Get reasonable. 180 degrees plus or minus how much?

Due to space constraints I can not use an acceleromete hence am using a tilt switch

You are doing something wrong, then. An accellerometer is smaller than any mechanical device you could use.

Yeah paul I am aware of it , its just that I want a signal when the angle is 180 +,- 1degree is acceptable. The accelerometer modules i ahve come across are 2cm sq minimum and i am in need of something which is max. 1cm sq. I have seen a couple of IMU especialy from espon, and invesense but dont know how to use them with an arduino. Hence I decided on using a tilt switch. I am a novice and still learning arduino code, so basically I try to use codes from the forums( which are open,with no copyright issues) and learn from them. I have a IMU code along with OLED display which is working fine. What I am looking for is a way to pause or freeze the display on the screen when the tilt switch registers 180 degree/is low. I read somewhere that you can write a pause "reload " command or " stop scroll" when certain conditions are met. The ode I am using for display does not have a reload, or scroll command, secondaly I am notsure where exactly to put this command line . It would be a help if somebody could explain this to me.

PS: I want to use the tilt switch as a push button which when pressed goes low and stops the display of IMU readings on the screen at that moment and stays that way till reset button is pressed.