Switching and dynamic wavelength conversion of light are demonstrated in a fiber grating cavity detuned by highvoltage electrical pulses. The cavity dynamics is studied using a heterodyne technique in which the frequencyshifted light, trapped by the cavity, mixes with the backreflected light at the incident frequency. We find that the frequency shift scales linearly with the energy of the electric driving pulses.