The motion control of a levitated nanoparticle plays a central role in optical levitation for fundamental studies and practical applications. Here, we presented digital parametric feedback cooling based on square wave modulation by switching trapping laser intensity between two levels. The effects of the modulation depth and modulation signal phase on the cooling result were investigated in detail. Using such a digital parametric feedback method, the center-of-mass temperature of all three motional degrees of freedom can be cooled to dozens of millikelvin. The flexibility and agility of the digital feedback control pave the way for a variety of motion control modes.