Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 394-02 Spring '07© 2007 JW Ryder1 Week 2 Material  Install and Configure  Mindstorms NXT Software and User Guide  LeJOS NXJ 0.1.0 Alpha  Java.

Similar presentations


Presentation on theme: "CSCI 394-02 Spring '07© 2007 JW Ryder1 Week 2 Material  Install and Configure  Mindstorms NXT Software and User Guide  LeJOS NXJ 0.1.0 Alpha  Java."— Presentation transcript:

1 CSCI 394-02 Spring '07© 2007 JW Ryder1 Week 2 Material  Install and Configure  Mindstorms NXT Software and User Guide  LeJOS NXJ 0.1.0 Alpha  Java  General  Program examples

2 CSCI 394-02 Spring '07© 2007 JW Ryder2 Install and Configure Mindstorms  Install Mindstorms NXT  Software – 1 CD – Take all defaults  User Guide – 1 CD on c:\ drive  Pass around while we talk

3 CSCI 394-02 Spring '07© 2007 JW Ryder3 Reload Mindstorms Firmware  Start up Mindstorms Software  Click Tools -> Update NXT Firmware  Select v1.03 then press download  Your brick must be in firmware reset mode for this to work  When you turn the brick on, you should once again see the Lego logo etc as before

4 CSCI 394-02 Spring '07© 2007 JW Ryder4 Create shortcuts Minstorms Stuff  Mindstorms NXT software  C:\Program Files\LEGO Software\LEGO MINDSTORMS Edu NXT\MINDSTORMSNXT.exe  User Guide  C:\NXT User Guide\winopen.exe  Start Mindstorms NXT Software  Download NXT firmware v1.3

5 CSCI 394-02 Spring '07© 2007 JW Ryder5 LeJOS NXJ 0.1.0 Alpha  Released Jan. 10, 2007  Specifically for the NXT  Missing support for Sound, Bluetooth, and Ultrasonic Sensor (I2C)  Version: Alpha 0.1.0 - lejos_NXJ_win32_0_1_0alpha.zip

6 CSCI 394-02 Spring '07© 2007 JW Ryder6 Install LeJOS NXJ 0.1.0 Alpha  Unzip LeJOS NXJ 0.1.0 Alpha software and documentation to c:\  This will create a folder on c:\ called c:\lejosnxj0_1_0alpha  Check to make sure it is there  LeJOS needs a special tool called LibUsb to be able to download programs to the NXT  We must install

7 CSCI 394-02 Spring '07© 2007 JW Ryder7 Install LibUsb  Can be found at http://libusb-win32.sourceforge.net  Package Name: Snapshot: libusb-win32-filter-bin- 20060827.exe  Run the setup EXE program. Use all defaults  Installs under c:\Program Files\LibUSB-Win32  Find its bin directory then  execute install-filter.exe one time by double-clicking on it

8 CSCI 394-02 Spring '07© 2007 JW Ryder8 Environment Variables  System -> Advanced -> Environment Variables  Change in the ‘System Variables’ section  Always add to the end of the list if one exists  before adding separate the last one and your new one with a semi-colon (;)

9 CSCI 394-02 Spring '07© 2007 JW Ryder9 PATH Environment Variable  PATH should contain: .;c:\program files\java\jdk1.5.0_10\bin;c:\lejosnxj0_1_0alpha\bin

10 CSCI 394-02 Spring '07© 2007 JW Ryder10 CLASSPATH Environment Variable  CLASSPATH should contain: .;c:\394robotics\javaprojects;c:\lejosnxj0_1_0alpha\lib\classes.jar;c:\lejosnxj0_1_0alpha\lib\jtools.jar

11 CSCI 394-02 Spring '07© 2007 JW Ryder11 Other Environment Variables  LEJOS_HOME=c:\lejosnxj0_1_0alpha  JAVA_HOME=c:\Program Files\Java  You should now be done with install and configure for a while

12 CSCI 394-02 Spring '07© 2007 JW Ryder12 LeJOS NXJ 0.1.0 Alpha Docs  Good docs in c:\lejosnxj0_1_0alpha\docs\apidocs  Add a shortcut to the desktop for the API docs  index.html

13 CSCI 394-02 Spring '07© 2007 JW Ryder13 LeJOS NXJ 0.1.0 Alpha Samples  Good docs in c:\lejosnxj0_1_0alpha\samples  One sample per folder, just like you will write your code  If you have not created a csci394projects folder yet on the c:\ drive, do it now

14 CSCI 394-02 Spring '07© 2007 JW Ryder14 Important Notes about Using NXJ  http://comments.gmane.org/gmane.comp.java. lejos/2976  To Upload/Download for NXJ  Press reset button on brick for at least 4 seconds to put into firmware update mode

15 CSCI 394-02 Spring '07© 2007 JW Ryder15 Java  Note: It is best to have jdk-1_5_10 installed on your system. That is what I am going to refer to.  9 will work and probably 1.6 too.  You will need to make your environment variables match the version of Java you have on your system  Info about installing JDK 1.5.0_10 SDK next

16 CSCI 394-02 Spring '07© 2007 JW Ryder16 Java 1.5.0_10 SDK  Download jdk-1_5_10-windows-i586-p.exe from the Sun web site  java.sun.com  Allow default installation to:  c:\program files\java\jdk1.5.0_10  Add environment variable values:  PATH:.;c:\program files\java\jdk1.5.0_10\bin  CLASSPATH:. Note: A single period

17 CSCI 394-02 Spring '07© 2007 JW Ryder17 Java Runtime Environment  Allow the JRE 1.5.0_10 to be installed during the normal installation  Installed in c:\program files\java\jre1.5.0_10

18 CSCI 394-02 Spring '07© 2007 JW Ryder18 Java 1.5.0 Documentation  jdk-1.5.0-doc.zip – Get from Sun web site  Unzip into c:\program files\java  Creates a ‘docs’ folder under ‘java’ folder

19 CSCI 394-02 Spring '07© 2007 JW Ryder19 Java New Folder Summary  Three new folders under c:\program files\java  docs, jdk1.5.0_10, and jre1.5.0_10

20 CSCI 394-02 Spring '07© 2007 JW Ryder20 LeJOS NXJ Java Education  The SAMPLES are your friends. Start with the following order:  HelloWorld.java – let’s review and then try it  MemoryTest.java  TestButton.java  TestMotor.java  TestSensor.java  and so on ….  Copy HelloWord folder under your csci394projects folder

21 CSCI 394-02 Spring '07© 2007 JW Ryder21 LeJOS NXJ Compile and Link  Open a command prompt window (DOS window) and cd to the folder with your copy of HelloWorld in it  Compile a program: lejosjc Test.java  Link a program: lejoslink Test -o Test.bin  Test.bin is now ready to download

22 CSCI 394-02 Spring '07© 2007 JW Ryder22 LeJOS NXJ Download  You must first  Reset the brick to “firmware reset” mode  Turn the brick on  On bottom of brick, press reset for at least 4 seconds  Do you have a blank screen? (yes = good)  Turn the brick on (do you hear a tick tick?) (yes = good)  Download a program: lejosdl Test.bin

23 CSCI 394-02 Spring '07© 2007 JW Ryder23 HelloWorld.java Example  In c:\csci394projects\HelloWorld  lejosjc HelloWorld.java  Input: HelloWorld.java, Output: HelloWorld.class  lojoslink HelloWorld –o HelloWorld.bin  Input: HelloWorld.class, Output: HelloWorld.bin  Ensure brick in reset mode and turned on in that order  lejosdl HelloWorld.bin  Watch the NXT LCD screen. What happens?


Download ppt "CSCI 394-02 Spring '07© 2007 JW Ryder1 Week 2 Material  Install and Configure  Mindstorms NXT Software and User Guide  LeJOS NXJ 0.1.0 Alpha  Java."

Similar presentations


Ads by Google