<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Using_the_Library</title><link>https://sourceforge.net/p/frcsimulator/wiki/Using_the_Library/</link><description>Recent changes to Using_the_Library</description><atom:link href="https://sourceforge.net/p/frcsimulator/wiki/Using_the_Library/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 25 Oct 2012 19:53:04 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/frcsimulator/wiki/Using_the_Library/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Using_the_Library modified by Wolfgang Faust</title><link>https://sourceforge.net/p/frcsimulator/wiki/Using_the_Library/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Wolfgang Faust</dc:creator><pubDate>Thu, 25 Oct 2012 19:53:04 -0000</pubDate><guid>https://sourceforge.neta306568f71589b82763e114f5755eba0faf8ef97</guid></item><item><title>WikiPage Using the Library modified by Wolfgang Faust</title><link>https://sourceforge.net/p/frcsimulator/wiki/Using%2520the%2520Library/</link><description>&lt;pre&gt;--- v1
+++ v2
@@ -1,4 +1,4 @@
-Downloading the Library.
+Using the Library
 ===
 &lt;br/&gt;
 **There is a gui client that should be easier to work with, see [Getting Started with the GUI](../Getting_Started_With_The_GUI).**
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Wolfgang Faust</dc:creator><pubDate>Thu, 25 Oct 2012 19:51:33 -0000</pubDate><guid>https://sourceforge.net846ba57b5945a0766ab55fe77269034675b9a5bd</guid></item><item><title>WikiPage Using the Library modified by Wolfgang Faust</title><link>https://sourceforge.net/p/frcsimulator/wiki/Using%2520the%2520Library/</link><description>Downloading the Library.
===
&lt;br/&gt;
**There is a gui client that should be easier to work with, see [Getting Started with the GUI](../Getting_Started_With_The_GUI).**
&lt;br/&gt;
Download the wpilibj and library JARs or get the code from Subversion. Build it if necessary and replace your project's reference to wpilibj with a reference to our library. 

Running in the simulator.
===
1. Create a new Java project that references your code as a library or create a main class/main method in your existing code. There are 2 main ways of doing this:

Make a seperate main class
---
    :::Java
    public class SimAppName{
        public static void main(String[] args){
            // Start simulator here
        }
    }

Put the main class in your existing code
---
    :::Java
    public class RobotAppName extends SimpleRobot{ //Extends IterativeRobot, RobotBase, etc.
        public static void main(String[] args){
            // Start simulator here
        }
        //disabled,autonomous,operatorControl, and other methods
    }

2. Create a new Simulator object and start it.

Starting the simulator
---
    :::Java
    Simulator sim = null;
    try{
        sim = new Simulator("your.robot.app.package.RobotAppName");
    } catch(Exception e){
        // Print an error message here
        System.exit(2);
    }
    sim.start();
This will work, but as you may have noticed, will fail when it tries to reference any modules. To solve this, see [Using the CRIO class](../Using_the_CRIO_Class).</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Wolfgang Faust</dc:creator><pubDate>Thu, 25 Oct 2012 19:45:33 -0000</pubDate><guid>https://sourceforge.netbfe8fd9afc0981d509c0d45dba9afed69a73a0a6</guid></item></channel></rss>