Sunspots

From ETC Public Wiki
Jump to: navigation, search

What are SunSPOTs?

SunSPOTS are wireless sensors developed by Oracle. These are their features.

  • Experimental Platform
  • Small
  • Wireless Communication
  • Battery Powered
  • Easy to program – Java
  • 3D Accelerometer
  • Light Sensor
  • Temperature Sensor
  • Digital/Analog I/O pins
  • LEDs
  • Two Switches


Getting Started


How to deploy applications to SunSpots

  • Open the project on netbeans
  • Right-click on the name of the project and choose Clean and Build
  • Make sure the target sunspot is connected to the computer.
  • Right-click on the name of the project and choose Deploy to Sun SPOT
  • It might be required to reset the sunspot while the application is being deployed. Just press the sunspot button once.
  • More information on this can be found on the sunspot tutorial http://www.sunspotworld.com/Tutorial/index.html


How to run a Desktop-side application

  • Open the project on netbeans
  • Right-click on the name of the project and choose Clean and Build
  • Make sure the basestation is connected to the computer.
  • Right-click on the name of the project and choose run
  • More information on this can be found on the sunspot tutorial http://www.sunspotworld.com/Tutorial/index.html


Integration of SunSpots and Processing

  • Create a new Sunspot Project from scratch or reuse one of the demos(recommended).Instructions on how to create a new project are in SunSpot’s Programmers Manual
  • Create a libraries folder
  • Paste on libraries folder the processing folder.
  • There is a netbeans- processing template here: http://code.google.com/p/netbeans-processing-template/ it is really basic but it works. In the same page there are installations instructions.
  • The processing library has to be added to the project. This has to be done in two ways. First, right click on the project name on netbeans properties -> Java Sources Classpath and Add JAR/Folder. Navigate to ./libraries/processing/ilb and add core.jar Also any library that is going to be use with the Sunspot project has to be specified on the build.properties file. On the user.classpath add the path to the library. In this case core.jar
  • If using opengl library in processing, you need to copy all the files in "processing-1.2.1\libraries\opengl\library" to "Sun\SunSPOT\sdk\lib", or there will be link errors
  • The main class has to extend to PApplet and the main function of this class has to have the following command :
       PApplet.main(new String[]{"ribbons.Main"})

where “ribbons” is the name of the package on which the main class is.

  • Other classes (other than main) using processing cannot extend to PApplet. They have to have a variable of type PApplet that represents the parent PApplet. The application ribbons is a good example of this.


Where can I find Demos?

Demos can be found on the Archive folder for !ON Interactive (\\randon\etc\projects\2011_semester_1\ion)