Software part two



The Sun SPOT was used for two things, to establish the direction of the cannon in terms of rotation on its Z-axis and to establish the angle of the cannon. The built in accelerometer was used to get the angle of the cannon. To get the angle from the accelerometer we used the following code,

import com.sun.spot.sensorboard.peripheral.LIS3L02AQAccelerometer;



private LIS3L02AQAccelerometer acc;

acc = (LIS3L02AQAccelerometer)EDemoBoard.getInstance().getAccelerometer();

int tilt = (int)Math.toDegrees(acc.getTiltY());

Software part one



The software is made up of three parts that we worked on simultaneously during the project.

Battleship game logic

Graphics

Sun SPOT host and client

This software recap will be about the Sun SPOT host and client and the hardware used. I will explain the primary functions of the software and provide some code examples so that others perhaps can implement it more easily than going through the documentation.

Exhibition

Exhibition

Exhibition

Exhibition

Exhibition