BumperCar.java
package Caprani;
import lejos.nxt.Button;
import lejos.nxt.SensorPort;
import lejos.robotics.subsumption.Arbitrator;
import lejos.robotics.subsumption.Behavior;
 
public class BumperCar {
    public static void main(String [] args) {
        Behavior b1 = new DriveForward();
        Behavior b2 = new HitWall(SensorPort.S2, SensorPort.S1);
        Behavior b3 = new Exit(Button.ESCAPE);
        Behavior [] bArray = {b1, b2, b3};
        Arbitrator arby = new Arbitrator(bArray);
        arby.start();
    }
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License