Fixes to "Line Following in Loop" Sample Solutions (#871)
Sample Solutions were wrong for both Methods of Line Following in a Loop
This commit is contained in:
parent
fd75bb61d6
commit
1f65cd59a8
@ -190,12 +190,10 @@ if (true) {
|
|||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
forever(function () {
|
forever(function () {
|
||||||
while (true) {
|
while (sensors.color3.color() == ColorSensorColor.Black) {
|
||||||
sensors.color3.pauseUntilColorDetected(ColorSensorColor.Black)
|
|
||||||
motors.largeBC.steer(-30, 50)
|
motors.largeBC.steer(-30, 50)
|
||||||
}
|
}
|
||||||
while (true) {
|
while (sensors.color3.color() == ColorSensorColor.White) {
|
||||||
sensors.color3.pauseUntilColorDetected(ColorSensorColor.White)
|
|
||||||
motors.largeBC.steer(30, 50)
|
motors.largeBC.steer(30, 50)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -209,11 +207,9 @@ Else the Color Sensor detects the color white, start motors ``B`` and ``C`` (dri
|
|||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
forever(function () {
|
forever(function () {
|
||||||
if (true) {
|
if (sensors.color3.color() == ColorSensorColor.Black) {
|
||||||
sensors.color3.pauseUntilColorDetected(ColorSensorColor.Black)
|
|
||||||
motors.largeBC.steer(-30, 50)
|
motors.largeBC.steer(-30, 50)
|
||||||
} else {
|
} else {
|
||||||
sensors.color3.pauseUntilColorDetected(ColorSensorColor.White)
|
|
||||||
motors.largeBC.steer(30, 50)
|
motors.largeBC.steer(30, 50)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user