Detecting tumble-switch state


I just have two questions, is it possible to read the state of a tumble switch? (I want to make animations with my Arduino, and use a tumble switch to switch animation)

Second; how do I have to wire this up to interface with it?


Yes that's the kind of switch I mean. It has 3 legs.

I just want the Arduino to know the state. For example, I boot the Arduino, it has to see something like:

state == 1 // Do animation 1 state == 2 // Do animation 2

Very simple detection. Do you have a simple example for me, on how to do this?

Look at this tutorial, it is the most basic thing imaginable, replace your switch for the button.