@@ -27,6 +27,17 @@ It kind of felt as if it was a creature that tried to avoid decection by being a
...
@@ -27,6 +27,17 @@ It kind of felt as if it was a creature that tried to avoid decection by being a
The robot had an interesting behaviour, when a loud sound occurred it would drive with high speed forward until it hit a wall, this resulted in lowering the noise from the motor and the robot now started backing away from the wall until another loud sound occur. Though every once in a while it would just continue driving into the wall.[4]
The robot had an interesting behaviour, when a loud sound occurred it would drive with high speed forward until it hit a wall, this resulted in lowering the noise from the motor and the robot now started backing away from the wall until another loud sound occur. Though every once in a while it would just continue driving into the wall.[4]
```java
while(!Button.ESCAPE.isDown()){
soundLevel=sp.readRawValue();
leftPower=100-(soundLevel/5);
rightPower=100-(soundLevel/5);
leftMotor.controlMotor(leftPower,forward);
rightMotor.controlMotor(rightPower,forward);
}
```
// fil i googledrev: T_part1.java, also add code, comment
// fil i googledrev: T_part1.java, also add code, comment