SUNSPOTusingNetbeans

Introduction to SunSpot development using NetBeans for Newbies

By Ashwin Bhat K S and Rajath Shanbag


Some really cool online resources before you read the wiki


Contents


Instructions to build a simple demo Sun SPOT application in NetBeans.

  • Install the latest JDK
  • Insert the cd given with the sunspot and run SunSPOTSDKInstaller.jar
  • Just double click the jar file. If it does not open try the following command in the shell or command prompt
java  –jar   SunSPOTSDKInstaller.jar

File:1_SUNSPOTusingNetbeans.png

  • Click “Continue” button, Scroll to the bottom and click "Accept"

File:2_SUNSPOTusingNetbeans.png

  • Put a tick mark to the necessary items to be installed. Select a location for installing the software.
  • If you already have a JDK you will see that Supported JDK found message. You need not put a tick mark against JDK in that case.
  • And then select "Install"

File:3_SUNSPOTusingNetbeans.png File:4_SUNSPOTusingNetbeans.png

  • Accept the license agreement and select "Next >"

File:5_SUNSPOTusingNetbeans.png

  • Select all the components and select "next"

File:6_SUNSPOTusingNetbeans.png

  • Click next

File:7_SUNSPOTusingNetbeans.png

  • Again click "next" and wait for some time. In the end click "Finish".

File:8_SUNSPOTusingNetbeans.png

  • Say "Next”", Accept the license terms ,give an appropriate installation directory and select an appropriate JVM from the list and finally say finish. This will finish Netbeans 5.5 Installation.
  • Press "Continue"

File:9_SUNSPOTusingNetbeans.png

  • Press "Start IDE"

File:10_SUNSPOTusingNetbeans.png

  • NetBeans 5.5 will now open with a Welcome screen showing various Information and resources about the sunspot.Browse through the excellent resources for more information.

File:11_SUNSPOTusingNetbeans.png

  • Now connect one end of a USB cable to a standalone SUNSPOT ( Thicker of the two SUNSPOTS ) and other end to your computer and follow instructions to install the USB Driver.

Note: The SUNSPOT comes along with USB Driver for windows. File:12_SUNSPOTusingNetbeans.png

  • Click "Next"

File:13_SUNSPOTusingNetbeans.png

  • Click "Continue Anyway"

File:14_SUNSPOTusingNetbeans.png

  • Now we are Ready to deploy our first SUNSPOT Application
  • Go to “File -> Open Project” in the menu bar.

File:15_SUNSPOTusingNetbeans.jpg

  • Go to the “Demos” Folder In the SUNSPOT Installation Directory.
  • Here it is C:\Program Files\Sun\SunSPOT\Demos

File:16_SUNSPOTusingNetbeans.png

  • Click on AirText in the Demos folder
  • Click on the “Open Project Folder Button”

File:17_SUNSPOTusingNetbeans.png

  • Now AirText is listed in the projects Window.
  • Click on AirTextDemo.java file in the Project Explorer.

File:18_SUNSPOTusingNetbeans.png

  • In the Right Hand Side In the Editor Window. You can edit the message and the colour to be Shown.
  • This Demo will show "HI This is a Sun SPOT SPOT SPOT SPOT SPOT"
  • The Function swingThis( ) will display the string given as arguments when the SUNSPOT is swung to and fro.
  • The Function setColor will set the color in terms of RGB.

File:19_SUNSPOTusingNetbeans.png

  • Now in the Project Explorer Right Click on AirText and click "Build Project + Deploy to Sun SPOT"

File:20_SUNSPOTusingNetbeans.png

  • In the Output window you will see similar to what is shown below.

"Waiting for target to synchronise..."
"(Please reset SPOT if you dont get a prompt)"

  • Do wait for sometime and Then press the power button of the SUNSPOT which will restart / reset the SPOT.

File:21_SUNSPOTusingNetbeans.png

  • Make sure you get the Encircled message after resetting the SPOT.

"Download operation completed successfully" File:22_SUNSPOTusingNetbeans.png

  • Congratulations. You have deployed your first Application on your SUNSPOT.
  • Now Swing the SUNSPOT to and fro.
  • The accelerometer inside the SUNSPOT will detect the movement and the LEDs will give an effect of displaying the message .

File:23_SUNSPOTusingNetbeans.png

  • Similarly try the other demos and write an application of your own.
  • Happy Programming :)

See also SUNSPOTwithNetbeans

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo