2018-01-06 06:49:04 +01:00
|
|
|
# Cruise Control Activity 1
|
|
|
|
|
|
|
|
```blocks
|
|
|
|
let speed = 0;
|
2018-01-31 17:28:00 +01:00
|
|
|
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
2018-01-06 06:49:04 +01:00
|
|
|
if (speed < 100)
|
|
|
|
speed = speed + 10;
|
|
|
|
motors.largeBC.setSpeed(speed);
|
|
|
|
})
|
|
|
|
```
|