Changes between Version 6 and Version 7 of javaInterface

Show
Ignore:
Author:
goskab (IP: 128.193.61.159)
Timestamp:
09/16/09 09:49:14 (2 months ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • javaInterface

    v6 v7  
    1 == Java on your OSWALD == 
    2 This section describes how to use java on your OSWALD. The process is fairly simple, we will be working with a hello world program. There are a few steps, the first is to create the source, we will call it '''!HelloWorld.java''', make the file using a text editor and fill it in with the following contents. This step is done on your computer. 
    3 {{{ 
    4 #!java 
    5 class HelloWorld { 
    6     public static void main(String[] args) { 
    7         System.out.println("Hello World!"); 
    8     } 
    9 } 
    10 }}} 
    11 The next step is to compile the java file into a class file, the easiest way is to make a project in eclipse (cs161 students should know how to do this), a guide for that can be found [https://eclipse-tutorial.dev.java.net/eclipse-tutorial/part1.html here] (Or you can make the class file using another method described [http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html here]). Once you have made the project, run it once. Now navigate to the directory that your project is in, and find the '''!HelloWorld.class''' file, copy this to a flash drive, or SD card. Once you have put the card/drive into your OSWALD, open a terminal (click the little black icon on the bottom of the screen). Type one of the following commands: 
    12  
    13 For sd cards: 
    14 {{{ 
    15 #!sh 
    16 cd /media/mmcblk0p1 
    17 }}} 
    18 For flash drives: 
    19 {{{ 
    20 #!sh 
    21 cd /media/sda1 
    22 }}} 
    23 Finally, we can run the java program using: 
    24 {{{ 
    25 #!sh 
    26 java HelloWorld 
    27 }}} 
    28 If successful you should see: 
    29 {{{ 
    30 #!sh 
    31 Hello World 
    32 }}} 
    33 On your terminal. 
    341== Oswald Joystick Interface, in Java == 
    352This is a temporary page for CS162 students to access the joystick on the OSWALD through java. This requires no extra libraries, it just opens the joystick device and reads data in. To use this on your oswald, please use the !OswaldInterface class, as it will be the easiest. When a joystick is created on a system without a joystick, a little interface will pop-up allowing the user to shake one of the joystick axes. This will simulate a shake.