Code help needed for project

What sterretje said makes sense, but also, what kind of sensor do you have connected to pin 9?