We report the realization of variable structured illumination using a controlled Lissajous scanning MEMS mirror. The MEMS mirror was electrostatically operated at pseudo-resonant frequencies within the bandwidth. The pattern density was controlled by selecting the scanning frequencies with the greatest common divisor (GCD) greater than 1. The constant pattern was achieved by modulating a laser beam at the least common multiple (LCM) of the scanning frequencies. Variable structured illumination was successfully achieved by controlling both the GCD of scanning frequencies as well as the phase of operating signals. This method can provide a new direction for 3D MEMS imaging applications.