Skip to content

Commit

Permalink
ref #9 : removed library parameter & commeted out some unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLucian committed May 4, 2017
1 parent 07e1673 commit d040691
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Software/Java8/examples/src/org/iot/raspberry/examples/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
public class Runner {

public static void main(String[] args) throws Exception {
Logger.getLogger("DIO").setLevel(Level.WARNING);
Logger.getLogger("GrovePi").setLevel(Level.WARNING);
Logger.getLogger("RaspberryPi").setLevel(Level.WARNING);

Expand All @@ -27,13 +26,20 @@ public static void main(String[] args) throws Exception {
System.out.println("STOPING CURRENT SAMPLE");
System.exit(0);
}
/*
if (args.length != 2) {
System.err.println("You need to provide 2 arguments DIO|PI4J EXAMPLECLASS");
System.exit(-1);
}
*/
if (args.length != 1) {
System.err.println("You need to provide 1 argument - name of the class");
System.exit(-1);
}

control.createNewFile();


/*
String mode = args[0];
GrovePi grovePi;
switch (mode.toLowerCase()) {
Expand All @@ -46,8 +52,11 @@ public static void main(String[] args) throws Exception {
default:
throw new IllegalArgumentException("You must provide either DIO or PI4J implementation");
}
Example example = (Example) Class.forName("org.iot.raspberry.examples." + args[1]).newInstance();
System.out.println("RUNNING EXAMPLE: " + args[1] + " USING: " + args[0]);
*/

GrovePi grovePi = new GrovePi4J();
Example example = (Example) Class.forName("org.iot.raspberry.examples." + args[0]).newInstance();
System.out.println("RUNNING EXAMPLE: " + args[0] + " USING: PI4J");
final ExecutorService runner = Executors.newSingleThreadExecutor();
final ExecutorService consoleMonitor = Executors.newSingleThreadExecutor();
final ExecutorService fileMonitor = Executors.newSingleThreadExecutor();
Expand Down

0 comments on commit d040691

Please sign in to comment.