There are many ways in which to interface a toy with an electronic system. The main considerations are: What types of control does the toy have? With what can these types of control be replaced? To what should the replacement of control be mapped? For example, take a simple button on a toy. This can be replaced with a relay, 40106-based oscillator, 4066 switch IC, 4051 multiplexer IC, digital switching mechanism, mercury tilt switch, magnetic switch, mechanical switch. This can be mapped from the physical world (tilting, magnetism), analog electronics (using the resistance of a pot of a 40106 oscillator to set the triggering speed), MIDI (note on, note off, CC, pitch bend etc), serial (on / off), ethernet etc. Let’s examine an specific example of implementing this process. A simple toy phone was taken apart, and controlled via Teensy and USB-based MIDI.”

Link