forked from ProjectgroepA8/BroBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoeBot.java
39 lines (33 loc) · 942 Bytes
/
BoeBot.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package boebot;
import stamp.core.*;
public class BoeBot{
MotorAansturing motor;
Botsingdetectie botsingdetectie;
FysiekeIndicator fysiekeindicator;
public BoeBot(){
motor = new MotorAansturing();
botsingdetectie = new Botsingdetectie();
fysiekeindicator = new FysiekeIndicator();
motor.setSnelheid(100);
motor.setRichting(true);
motor.start();
while(true){
if(botsingdetectie.detectEdge()){
fysiekeindicator.setLed1(false);
fysiekeindicator.setLed2(false);
} else{
fysiekeindicator.setLed1(true);
fysiekeindicator.setLed2(true);
motor.noodStop();
motor.setRichting(false);
motor.start();
CPU.delay(3000);
motor.noodStop();
motor.turn(180);
motor.setRichting(true);
motor.start();
}
CPU.delay(1000);
}
}
}