|
Click here to run Chart in Simulation Mode
Click here to download Chart
The Chart applet illustrates a very simple Teleo Flash application. In this application, the code emulates a paper strip chart recorder, recording the input received from any Analog Input device. The charting functionality is provided by com.makingthings.Chart which can be used in other applications. To download the source code, click on chart.zip.
The applet can run in one of two ways, either connected to real hardware or in simulation mode. See the Chart 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 a potentiometer which is excellent for sensing rotation, a whole variety of sensors can be used for sensing 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.*; import com.makingthings.chart;
var ain : TIntroAin = new TIntroAin( 0 );
var viewer : TIntroAinInspector = new TIntroAinInspector( _root, ain );
var c : Chart;
_root.onLoad = function( )
{
c = new Chart( _root );
}
_root.onEnterFrame = function( )
{
c.setSampleNew( ain.getValue( ) );
}
For more in-depth information about the classes and their use, please see the Teleo Flash Class Reference.
|