Permalink
Browse files

mario on remote - I think so

  • Loading branch information...
1 parent 962ebde commit cc162494c059811bcce9bddac1e2c1da34830cea @bign8 committed Apr 28, 2012
Showing with 854 additions and 37 deletions.
  1. +9 −7 src/Controller.java
  2. +2 −5 src/Engine.java
  3. +804 −0 src/Entertain.java
  4. +13 −3 src/Intelligence.java
  5. +26 −22 src/Remote.java
View
@@ -8,29 +8,31 @@
public class Controller {
public static void main(String args[]) {
+ new Entertain();
+
//Ignition
Engine engine = new Engine();
Thread engineThr = new Thread(engine);
- engineThr.setPriority(Thread.MAX_PRIORITY-2);
+ engineThr.setPriority(Thread.MAX_PRIORITY-3);
engineThr.start();
// Steering wheel
SteeringWheel wheel = new SteeringWheel();
Thread wheelThr = new Thread(wheel);
- wheelThr.setPriority(Thread.MAX_PRIORITY-3);
+ wheelThr.setPriority(Thread.MAX_PRIORITY-4);
wheelThr.start();
// Headlights
Sonar headlight = new Sonar();
Thread headlightThr = new Thread(headlight);
- headlightThr.setPriority(Thread.MAX_PRIORITY);
+ headlightThr.setPriority(Thread.MAX_PRIORITY-1);
headlightThr.start();
// GPS
GPS garmin = new GPS();
- Thread garminThr = new Thread(garmin);
- garminThr.setPriority(Thread.MAX_PRIORITY-4);
- garminThr.start();
+ //Thread garminThr = new Thread(garmin);
+ //garminThr.setPriority(Thread.MAX_PRIORITY-5);
+ //garminThr.start();
//Remote
Remote remote = new Remote();
@@ -41,7 +43,7 @@ public static void main(String args[]) {
// Brain
Intelligence brain = new Intelligence(engine, wheel, headlight, remote);
Thread brainThr = new Thread(brain);
- brainThr.setPriority(Thread.MAX_PRIORITY-1);
+ brainThr.setPriority(Thread.MAX_PRIORITY-2);
brainThr.start();
// Debugging - can comment out for production
View
@@ -85,11 +85,8 @@ else if (rpm < arrayOfSpeeds[velocity + 3])
//}
//limiter
- if (power > 16)
-
- power = 16;
- if (power < -16)
- power = -16;
+ if (power > 16) power = 16;
+ if (power < -16) power = -16;
motor.setPower(power);
// Pause thread execution
Oops, something went wrong. Retry.

0 comments on commit cc16249

Please sign in to comment.