Step into the light, please
While our Scratch sprites can't see the outside world, we can use the light sensor on the PicoBoard to control a sprite based on the amount of light detected by the sensor.
For this exercise, we'll modify a dragon sprite and make it grow based on the amount of light it receives.
Time for action
Scratch includes several sprites that have scripts by default, which means the sprite is already programmed to do something. We're going to use such a sprite to jump-start this exercise:
Open a new Scratch project, and select the choose new sprite from file option.
Open the Fantasy folder and select the Growing Dragon sprite. It's the dragon designated as having 1 script.
The sprite contains one simple script that sets the size of the dragon based on the loudness block. Click the flag and make some noise. See the dragon expand and contract.
Now, replace the loudness block that's inside the set size to block with the sensor value block. Select light from the drop-down list.
Enable...