-package nl.ru.des;
+package nl.ru.des.behaviours;
import lejos.hardware.Sound;
import lejos.hardware.motor.EV3LargeRegulatedMotor;
+import lejos.robotics.Color;
import lejos.robotics.subsumption.Behavior;
+import nl.ru.des.bluetooth.ColorMemory;
+import nl.ru.des.sensors.ColorSensor;
public class WandererBehaviour implements Behavior {
private EV3LargeRegulatedMotor leftMotor, rightMotor;
leftMotor.forward();
rightMotor.forward();
while (!suppressed) {
- String current = colorSensor.getCurrentColor();
- if (current == "Yellow" || current == "Blue" || current == "Red") {
+ int current = colorSensor.getCurrentColor();
+ if (current == Color.YELLOW || current == Color.BLUE || current == Color.RED) {
Sound.beep();
- BTController.SendMessage(current);
+ cm.addColor(current);
}
Thread.yield();
}
public void suppress() {
suppressed = true;
}
-
}