|
Click here to run Rotator in Simulation Mode
Click here to download Rotator
The Rotator applet illustrates a very simple Teleo Flash application. In this application, a movie clip (the Teleo Flash puzzle piece in the center) rotates at a speed proportional to the input received from any Analog Input device. To download the applet, click on rotator.zip.
The applet can run in one of two ways, either connected to real hardware or in simulation mode. See the Rotator running in simulation mode here.
To set up an actual working application with Teleo hardware, see the diagram below. A potentiometer is connected to one of the module's inputs, the module is connected to power, and also via USB to the computer.

Although we're illustrating the potentiometer which is excellent for sensing rotation, a whole variety of sensors can be used to sense qualities like light, temperature, object proximity, pressure, tilt, magnetic fields and so on.
In the first frame of the main timeline there is the following code:
import com.makingthings.*;
var ain:TIntroAin = new TIntroAin( 0 );
var viewer:TIntroAinInspector = new TIntroAinInspector( _root, ain );
tPiece.onEnterFrame = function()
{
var v:Number = ain.getValue();
tPiece._rotation += v - 16;
valueText.text = "Ain 0 : " + v;
}
For more in-depth information about the classes and their use, please see the Teleo Flash Class Reference.
|