Toolkit Features

This page is not so much a step-by-step procedure for accomplishing a single task with the NETLab Toolkit, but rather a good checklist of important things to know and try after you get started using NLTK.

You can click on the title of each section to expose or hide its contents.

Essentials » Things You Can Do With The Toolkit » Use the XBee for Wireless Sensing » Create Sensor Networks »
  1. Suppliers: Look at the list of Suppliers for good sources of vendors of get tools, components, and materials.
  2. Sensors & Effectors: Learn about different kinds of input devices (Sensors) and output devices (Effectors) that you can use in projects.
  3. XML Preferences: When you change any of the on-screen settings in a Widget, the settings for all the widgets in the current SWF are saved to a file. This way, the next time you open the SWF, the last used settings will be restored. More info…
  4. Standalone SWF: If you want to run your SWF file containing your widgets and application in full screen mode, you need to run it outside of the Flash Application, i.e. from the desktop. Because the widgets use sockets to communicate to the Hub, Flash requires that you allow it to do so via the Flash Security Settings. More info…
  5. Firewall Issues: If you find that the widgets are unable to communicate with the Hub, check your Firewall – it may be blocking communications to the Hub. More Info…
Powered by Hackadelic Sliding Notes 1.6.5

  1. Make things move:
    Using the ServoOutput widget, you use a motor to physically move objects or parts of objects. This widget allows you to either:

    • Set the rotational position of a servo motor. For example, you can tell the motor to move from 45 degrees to 90 degrees. This works with conventional servo motors
    • Set the speed and rotational direction of a servo motor. For example, to power wheels of a robot, you can set the speed and direction of the motor. This requires a continuous servo (i.e. a servo that’s been modified so it can rotate continuously rather than having stops)

    In addition, if you want to control small DC motors, you can use the AnalogOutput widget. Because these motors (especially the more powerful ones) can sometimes cause electrical problems for the microcontroller, it is best to use a system specifically designed for controlling motors. For example, the Make Controller or a motor shield for the Arduino.

  2. Control lighting:
    Using the DMXOut widget and a USB hardware adapter, you can control commercial computer controlled lighting systems. There are many low-cost DMX Lighting systems, as well as high-end systems that are used for television and concert lighting show-control.Alternatively, if you want to control LEDs, you can use the DigitalOut widget and turn a single LED on or off. And you can use AnalogOut to dim LEDs up and down.
  3. Count sensor events:
    Using the Counter widget, you can count every time a sensor rises above a certain threshold, for example to advance through a series of slide images each time a physical button is pressed, or switch to a different audio clip. Counter can also be used to toggle something on and off, since if it only increments once, and then returns to zero, a press of a momentary switch will first make the Counter will advance to 1, and with the next press of the switch, it will return to zero. This is the default behavior of Counter.
  4. Rotate and move graphics or video in 3D:
    Using the ClipControl widget, you can change the 3D orientation of any movieClip using the rotationX, rotationY, rotationZ properties. In addition, you can move a movieClip forward and back in 3D space using the z property. This works with video objects as well.If you are controlling multiple movieClips in Z space, and want to make sure that those graphics “closer” to the user are in-front of other graphics that are “farther away”, put all of the movieClips in another movieClip, and then use the ZSortClips widget to set their display order.
  5. Use ActionScript code with Widgets:
    Using the Insert widget, you can use ActionScript code to either process data coming in from sensors, or send data to other widgets, or both. For example, if your project needed to monitor a light sensor and a motion sensor, and if the light is low and the motion detector senses a person, then turn on a light. In this scenario, you could use Insert widgets and write some code to test for the right conditions, and the send the right data out to a DMXOut widget to turn on the light.
  6. Work with Lists of Things:
    You can use the ListItems widget to work with lists of things. For example, if you want to play a series of .mp3 files in a particular order, or even randomly, you can create the list of files in a standard text file, and then use ListItems in combination with SoundControl. The VideoControl widget also works with ListItems.To try this out with Sound Control, create a new AS3 document, put AnalogInput, ListItems, and SoundControl widgets on the state, and use these listItemsFiles.zip to select between 6 different sound files.
  7. You can also use ListItems in combination with ActionScript code and any kind of data. For example, if you wanted to work with a list of text phrases, and wanted to display a different phrase each time a sensor value went above a threshold, you could use AnalogIn, Insert, and ListItems widgets in combination to do this. In this case, the Insert widget would have the instance name of the AnalogInput as its inputSource, and use the name of the ListItems widget with the nextItem() (e.g. nameList.nextItem() ) function to get each name and set the value of a Flash text object.Sample code – assumes that the Insert widget has an instance name of insert1, the ListItems widget has an instance name of phrases, and there is a dyanamic text object on the stage with the name myText.
    insert1.insertInput = processInput;
    
    var lastValue = 0;
    
    function processInput(inputValue, id) {
         // inputValue is the value from Insert's inputSource
         // id is the instance name of the Insert widget sending the value
    
            // check for transition from below threshold to above 500
    	if (inputValue > 500 && lastValue <= 500) {
    		myText.text = phrases.nextItem();
    	}
    	// save the received value so we can compare next time
    	lastValue = inputValue;
    }

    Sample Code: phraseList (includes text file with gibberish text phrases)

Powered by Hackadelic Sliding Notes 1.6.5

The XBee is a small radio that has the ability to transmit sensor values to another XBee radio. So if you attach a receiver XBee to your computer, and place a remote transmitter XBee with sensors attached, your computer can get the sensor values from the remote XBee. The initial set up of XBee radios is somewhat complicated. But once properly configured, they work quite reliably. More info…

Powered by Hackadelic Sliding Notes 1.6.5

The NETLab input widgets are capable of getting sensor values from a Hub running on another computer using the remoteHubIP parameter of the widget and setting it to the IP address of the remote computer (a local copy of the Hub must also be running for most widgets). This means that your project can listen to remote sensors, and in effect, you can create a sensor network by having multiple computers, each with sensors attached to them. All of the computers can access any of the sensors attached to any of the other computers.

In addition, any computer can also control outputs on any other computer. So for example, computer A can make a servo motor on computer B change position.

A further possibility is to use a dedicated computer as a sensor gateway. In this approach, the gateway computer would have an XBee receiver attached to and run the Hub. Then up to 255 remote XBees could be configured to work with the gateway. Any other computer could talk to the gateway to get sensor values from any of the remote XBees without the need for having a local XBee receiver, or even to be in range of the XBees. If the gateway computer has a public IP address, then any application, anywhere in the world could access the sensors on the sensor network created by the gateway.

Powered by Hackadelic Sliding Notes 1.6.5

Last modified April 4th, 2012