Navigation:

» Get the Software
» Robot View
> Load & Run the Demo
» Your Own Program

Load and Run the Demo Program

When you downloaded the SDK, you got a set of Sun SPOT demos, and one of them is made for the emulated robot. Let’s load and run this demo.

Right click the emulated Sun SPOT device in SPOT View, and select Deploy Midlet Bundle... . This brings up the “file chooser,” with which you can navigate to the following file:

SunSPOT > sdk > Demos > iRobotCreateDemo > build.xml

Note on Windows, some representations of the file name hide the .xml suffix. On the Mac, the file chooser will look like this.

file chooser as seen on Mac

Select the Open button, and the code will compile and deploy to the emulated Sun SPOT. Progress bar windows will pop up as the code is compiled and deployed. On some versions of Windows, a "block / unblock" dialog may appear the very first time you do this.

Next, you should create an output window so you can see the program's System.out.println() statements. Right-click the Sun SPOT icon in SPOT View, and from the pop-up menu, select

Display application output > in Internal Frame
.

This will create a window beneath the emulated Sun SPOT for showing text output from running applications.

text output from emulated Sun SPOT

 

Now we’ll run the program.

emulated spot run midlet
Right click the emulated SunSPOT to pop up the menu, and select RunMIDlet > IRobotCreateDemo.This will show the IRobotCreateDemo icon attached to the emulated SPOT, indicating this program is running. The emulated Robot will start to move on the screen.
application icaon appears

In the demo, the emulated robot bumps into each of the four walls, measuring distances as it goes so it can calculate and move to the exact center of the space. If you make another robot and have two run at the same time, they might bump into each other and thus settle into the center of their own portion of the room.

Note: feel free to try out the + and - buttons along the bottom of the two views: zooming out can make it easier to work with multiple robots and larger Robot View spaces.