Permalink
Browse files

began ensuring all examples are up to date, and fixed a few bugs whil…

…e I was at it
  • Loading branch information...
1 parent f7754cd commit 85284f92727b4ff0c99715485819a63d33ca7456 @bgw bgw committed Jan 8, 2011
Showing 501 changed files with 148 additions and 98 deletions.
View
@@ -15,7 +15,7 @@ consoleDownload/bin
*.out
*.sql
*.sqlite
-cbc/CBCJVM/examples/*.class
+cbc/CBCJVM/examples/**/*.class
ehthumbs.db
Icon?
Thumbs.db
Binary file not shown.
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Mon Feb 08 17:02:08 EST 2010
-version=0.0.1-SNAPSHOT
-groupId=CBCJVM
-artifactId=cbcjvm-blobItemSizer-test
@@ -1,10 +1,7 @@
-//package cbccore.tests;
-
import cbccore.Device;
import cbccore.events.Event;
import cbccore.events.EventManager;
import cbccore.events.EventListenerAdapter;
-//import cbccore.motors.listeners.StopMotors;
import cbccore.sensors.buttons.ButtonEmitter;
public class Main {
@@ -41,6 +38,7 @@ public void event(Event type) {
public static void main(String[] args) {
//Device.init();
+ System.out.println("Press the A button.");
new Main().run();
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Sun Feb 14 17:36:22 EST 2010
-version=0.0.1-SNAPSHOT
-groupId=CBCJVM
-artifactId=cbcjvm-buttons-test
Binary file not shown.
@@ -1 +1 @@
-int main(){chdir("/mnt/user/code/CreateDistanceSensor/target/classes");system("/mnt/user/jvm/java Main");}
+int main(){chdir("/mnt/user/code/CreateDistanceSensor/bin");system("/mnt/user/jvm/java Main");}
@@ -1,8 +1,26 @@
+/*
+ * This file is part of CBCJVM.
+ * CBCJVM is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * CBCJVM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with CBCJVM. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import cbccore.sensors.*;
import cbccore.sensors.analog.*;
import cbccore.sensors.buttons.*;
import cbccore.movement.DriveTrain;
-import cbccore.movement.CreateDriveTrain;
+import cbccore.movement.plugins.create.CreateMovementPlugin;
+import cbccore.create.Create;
+import cbccore.create.CreateConnectException;
import cbccore.events.*;
import java.util.Arrays;
import java.util.ArrayList;
@@ -11,7 +29,8 @@
public static void main(String [] args) {
System.out.println("Please press the Black Hardware Button to start.");
- EventManager.get().connect(ButtonEmitter.BlackButtonReleased, new StartListener(0));
+ EventManager.get().connect(ButtonEmitter.BlackButtonReleased,
+ new StartListener(0));
ButtonEmitter.get().start();
}
@@ -25,11 +44,18 @@ public static void main(String [] args) {
public StartListener(int port) {
distSensor = new ETSensor(port);
- dt = new CreateDriveTrain(1., false);
+ try {
+ dt = new DriveTrain(
+ new CreateMovementPlugin(new Create(), 1., false)
+ );
+ } catch(CreateConnectException ex) {
+ System.out.println("Create connection failed.");
+ }
}
public void event(Event e) {
- EventManager.get().disconnect(ButtonEmitter.BlackButtonReleased, this);
+ EventManager.get().disconnect(ButtonEmitter.BlackButtonReleased,
+ this);
ButtonEmitter.get().exit();
double dist = distSensor.getCm(50, 10);
Binary file not shown.
@@ -0,0 +1,36 @@
+/*
+ * This file is part of CBCJVM.
+ * CBCJVM is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * CBCJVM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with CBCJVM. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import cbccore.movement.DriveTrain;
+import cbccore.movement.plugins.create.CreateMovementPlugin;
+import cbccore.create.Create;
+import cbccore.create.CreateConnectException;
+
+public class Main {
+ public static void main(String [] args) {
+ DriveTrain dt = null;
+ try {
+ dt = new DriveTrain(
+ new CreateMovementPlugin(new Create(), 1., false)
+ );
+ } catch(CreateConnectException e) {
+ System.out.println("Create failed to connect.");
+ System.exit(1);
+ }
+ dt.moveCm(100., dt.getMaxCmps()*.8);
+ dt.rotateDegrees(180., dt.getMaxDegreesPerSec()*.8);
+ }
+}
@@ -1,13 +0,0 @@
-import cbccore.movement.DriveTrain;
-import cbccore.movement.plugins.create.CreateMovementPlugin;
-
-public class Main {
- public static void main(String [] args) {
- DriveTrain dt = null;
- try {
- dt = new DriveTrain(new CreateMovementPlugin(1., false));
- } catch(Exception e) { e.printStackTrace(); System.exit(-1); }
- dt.moveCm(100., dt.getMaxCmps()*.8);
- dt.rotateDegrees(180., dt.getMaxDegreesPerSec()*.8);
- }
-}
Binary file not shown.
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Sun Mar 07 21:00:31 EST 2010
-version=0.0.1-SNAPSHOT
-groupId=CBCJVM
-artifactId=cbcjvm-createDriveTrain-test
@@ -1 +1 @@
-int main(){chdir("/mnt/user/code/ETCalibrator/target/classes");system("/mnt/user/jvm/java Main");}
+int main(){chdir("/mnt/user/code/ETCalibrator/bin");system("/mnt/user/jvm/java Main");}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Sun Feb 14 20:44:53 EST 2010
-version=0.0.1-SNAPSHOT
-groupId=CBCJVM
-artifactId=cbcjvm-frameBuffer-test
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 85284f9

Please sign in to comment.