pxt-ev3/docs/coding/cruise-control-1.md

10 lines
209 B
Markdown
Raw Normal View History

2018-01-05 21:49:04 -08:00
# Cruise Control Activity 1
```blocks
let speed = 0;
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
if (speed < 100)
speed = speed + 10;
motors.largeBC.setSpeed(speed);
})
```