I am rather confused about this. I know from Charles' law that under constant pressure, the volume of a gas is directly proportional to its absolute temperature i.e.
$$\frac{V_1}{T_1} = \frac{V_2}{T_2}$$
Thus accordingly, during compression, temperature of the gas would decrease. But in Lectures of physics ,vol 1 by Feynman, it is written:
Suppose that the piston moves inward, so that the atoms are slowly compressed into a smaller space. What happens when an atom hits the moving piston? Evidently it picks up speed from the collision. [...] So the atoms are "hotter" when they come away from the piston than they were before they struck it. Therefore all the atoms which are in the vessel will have picked up speed. This means that when we compress a gas slowly, the temperature of the gas increases.
(Constant pressure?) So, this is contrary to Charles' law. Why does this happen? Who is right? Or are they both correct? I am confused. Help.