reading a sensor and using an if statement

Thanks. They both look helpful. Looks like I have some homework to do. If there is interest, I'll post the final code that works.