I took apart a light up yoyo. When functioning, the yoyo would flash it's led when spun sufficiently quickly.
Taking the yoyo apart revealed a simple mechanism. There was a button cell battery, a spring and an LED. When the yoyo vibrates, energy is transferred to the spring. When the spring oscillates, it connects and disconnects the wire from the battery resulting in a strobe light effect. The yoyo broke because one of the wires was slightly deformed. I tested the LED by hooking it up directly to the battery inside the yoyo and it seemed to work fine. By adjusting the placement of the spring and closing the yoyo, it was made to work again!