I was driving & I would push gas petal all the way to floor & was barely moving on 2008 Chevrolet Cobalt

I put a scanner & got 0016, went to start next morn. Cranked but wouldnt start. I changed the camshaft & crankshaft sensers. Car started but still got message engine reduced power, put scanner on again & got code 0223 which is tpps. The senser is on gas pedal? How do I fix this problem of reduced eng. power? Any help would be greatly appreciated. Thks

Asked by for the 2008 Chevrolet Cobalt