Getting values from the sensor board
This recipe will get us ready to do all of the fun things a PicoBoard can do. We'll start off with the basics of getting some data from the sensor board.
Getting ready
Open up a new Scratch file to use. This recipe will strictly focus on storing the data from a sensor as a variable, so will be relatively short in length.
How to do it...
Follow the steps:
Create a new variable called Slider Value.
- Drag over a block (remember, this is in the Control category in Scratch 1.4, but in the Events category in version 2.0).
- Drop a block underneath the block from step 2. Note that in the older version of Scratch this is in the Variables category, but this category was renamed Data in version 2.0.
- Now we will use one of our new blocks from Sensing. Drop the block as shown in the following screenshot:
You should now have the code shown in the following screenshot in your script area. You can now use the variable as you would for any other variable in Scratch: