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

199 B

Cruise Control Activity 1

let speed = 0;
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
    if (speed < 100)
        speed = speed + 10;
    motors.largeBC.run(speed);
})