Sun SPOT Quick Start Tutorial:Loading and Running The Air Text Demo (https://www.sunspotworld.com/docs/Green/Tutorial/AirText.h
来源:互联网 发布:光之教堂平面图数据 编辑:程序博客网 时间:2024/04/30 05:45
Loading and Running The Air Text Demo
Now, lets try downloading another demo to a Sun SPOT. That will give you an idea of how to download Java programs to a Sun SPOT
Compile, Deploy and Run the Demo
- Within NetBeans, navigate to the Sun SPOT directory and then the Demos subdirectory. On a windows workstation, the absolute file path is usually
C:/Program Files/Sun/SunSPOT/Demos
. Open the project which is in the[SunSPOTdirectory]/Demos/AirText
directory. Make sure "Open as Main Project" is selected, then click on the "Open Project Folder" button.
NetBeans projects are simply folders with a NBProject folder in them. You can look at any of the files with ordinary editors.
- Clean and build this project. You can do this either by right-clicking on the project (control-click for a Macintosh) and selecting "Clean and Build Project" as shown below...
or you can select the "Build" menu from the main menu bar and select "Clean and Build Project" from that menu:
After you command the system to clean and build the project, you should see an output panel open at the bottom of the NetBeans window. The output panel will show the output from the compile operation. This text should end with "BUILD SUCCESSFUL" and the time it took to build the object code.
- Connect a free range Sun SPOT to the USB cable. Reset (or turn on) the free-range Sun SPOT by tapping the SPOT control button. The LED to the right will flash green during the synchronization.
- Select the project in the project window, right-click on it (control-click on a Macintosh), and select "deploy" from the pop-up menu. This will create a jar file from the compiled code and start to transfer it to the Sun SPOT.
.
The download operation will then pause with the words "Waiting for target to synchronize... (please reset SPOT if you don't get a prompt)". Just tap the control button to get the download to proceed. The LED to the right will flash green as the Sun SPOT attempts to synchronize with the host workstation.
If the deploy operation is successful, the output at the bottom of the NetBeans window will end with something like this:
If the words "Download operation completed successfully" do not appear, then the Sun SPOT is probably not synchronized with the host workstation. Try resetting the Sun SPOT again.
Troubleshooting: If you get output that looks like this:
If you see output that says "COM5 is in use" or "Port COMn unavailable..." that means that some other process is using the Sun SPOT and the deploy script can't write to it until that process is done with it. To fix this problem, you need to terminate the other Sun SPOT-related processes. Go to the upper left panel of the NetBeans window, where there are three tabs: Projects, Files and Runtime. Click on the Runtime tab.
Expand the "Processes" node. It will display a list of running processes.
Right clicking on a process will give you the option of terminating that process. Terminate all the processes. Click on the project tab again and try deploying the demo to the Sun SPOT again.
When you have successfully deployed the code to the Sun SPOT, turn the Sun SPOT off and disconnect the Sun SPOT from the USB cable. Now tap on the control button to start the demo.
Note: Nothing will happen happen after the reset. The LEDs on the sensor board will be off until you follow the directions below.
The Effect
This demo displays better in a darkened room, but anywhere that you can see the main string of eight LEDs will work. Hold the Sun SPOT up, with the radio antenna fin out to the left. Swing the Sun SPOT very quickly, as quickly as you can, from left to right and back again a few dozen times. Swing wide and fast. Go for a back and forth distance of one, two, or even three feet.
The Sun SPOT will sense the acceleration and will turn the LEDs on and off in such a way that your eyes will see words painted in the air by the Sun SPOT. The words will say "Hi!...This...is a...Sun...SPOT".
The next step is to modify the Air Text program and load the changed program on to a Sun SPOT.
- Sun SPOT Quick Start Tutorial:Loading and Running The Air Text Demo (https://www.sunspotworld.com/docs/Green/Tutorial/AirText.h
- Sun SPOT Quick Start Tutorial:Changing the Air Text Demo(https://www.sunspotworld.com/docs/Green/Tutorial/ModifyAirText.html)
- Sun SPOT Quick Start Tutorial (https://www.sunspotworld.com/docs/Green/Tutorial/Tutorial.html)
- Sun SPOT Quick Start Tutorial: Ectoplasmic Bouncing Ball Demo (https://www.sunspotworld.com/docs/Green/Tutorial/EctoplasmicBall
- Sun SPOT Quick Start Tutorial:The Basestation in Action(https://www.sunspotworld.com/docs/Green/Tutorial/Basestation.html)
- Frequently Asked Questions of SUN SPOT (http://www.sunspotworld.com/docs/general-faq.php)
- Troubleshooting FAQ (https://www.sunspotworld.com/docs/troubleshooting-faq.php)
- Introduction of SUN SPOT (transshipment from http://www.sunspotworld.com/about/index.php)
- Introduction of SUN SPOT II (transshipment from http://www.sunspotworld.com/about/index.php)
- Slurm Quick Start Tutorial
- Tibco RendezVous quick-start tutorial
- WPF/MVVM Quick Start Tutorial
- WPF - MVVM Quick Start Tutorial
- java Thread(http://java.sun.com/docs/books/tutorial/essential/threads)
- The Qt Quick Carousel Tutorial
- Delegates - a 15 minutes quick start tutorial
- xd.one Demo and Tutorial
- the quick tutorial with the regular
- 谈:"沉重的翅膀——软件开发,业务?技术? "
- GPS系统研发人员面试题(VC通讯)
- 放飞
- 圣诞节前发布的开源项目小结-欢迎补充
- 2007中国软件英雄会-七年的等待
- Sun SPOT Quick Start Tutorial:Loading and Running The Air Text Demo (https://www.sunspotworld.com/docs/Green/Tutorial/AirText.h
- 如何最快的销售砖头(2.0版)
- 如何编译 Exo platform
- 教学影片:如何利用Blend2设计Silverlight并配合ASP.NET
- 中国和西方文化劣根的比较
- 我的部落访客超过一万啦
- 放飞
- 如何最快的销售砖头(2.0版)
- Apache Geronimo 1.0 正式发布 - 明天来详细分析其组件