1.Set your ladder on the side of your house so that you can safely access the downslope edge of the roof. (As you face the house, the roof should slope up from right to left or from left to right, not away from you.) You should be able to reach the edge from the ladder; you won't need to get on the roof to do this.
2.Hold a framing square up against the roofline so that the long end of the "L" points toward the center of the roof and the short end points toward the ground. Essentially, you're forming a right triangle with the long and short sides of the framing square - the roof edge forms the hypotenuse, or third side.
3.Position the framing square so that the long end (the end that makes the horizontal line of your right triangle) meets the edge of the roof at the 12-inch mark.
4.Level the square horizontally.
5.Read the measurement on the short end (which is standing up vertically from the roof).
6.Remember: Rise over run. The rise is the measure on the vertical leg; the run is the 12-inch measurement on the horizontal leg. So if the vertical measurement is 5, the roof has a 5/12 pitch.
Some framing squares have measurements on both edges. Read the measurements on the inside edges if this is the case.
To match the pitch, simply use the same measurements on the object you're matching it to. For example, a frame for a basketball hoop should have a 5/12 pitch if it were to go on the roof in the above example. To do that, level the vertical object (the backboard, in this case) and measure out horizontally 12 inches. At that 12-inch point, the frame should be 5 inches above the ground.