Control motion with the slider
Next, we'll explore the slider sensor as we manipulate some gravity marbles. Like the sound and the light sensors, the slider outputs a numeric value between 0 and 100.
Let's experiment with Earth's greatest force.
Time for action – slide sensor
Like we did with the light sensor exercise, we're going to open a sprite that already has scripts associated with it. In this case, we'll use the gravity marbles.
Start a new Scratch project and select the choose new sprite from file option.
Delete the original sprite.
Open the Things folder and select the Gravity Marble sprite.
Click the flag and interact with the marble by pressing the arrow keys to make the marble rise and fall. Try to understand the code. When you've had enough, continue with the next step.
We want to raise the marble with the slider sensor on the PicoBoard. Replacethe if key up arrow pressed ? block with the greater than block from the Operators palette.
From the Sensing palette, add the sensor value block...