The elastic and inelastic scattering of polarized protons by carbon