Checking other connections
Similar to how we checked to see when the button is pressed, we can also see when the alligator clips are connected (either directly together or with something completing the circuit between them).
Getting ready
This recipe will simply show you the technique for checking a connection between the clips.
Before following the steps in the next section, open a new Scratch file.
How to do it…
Follow these steps to get going:
- Drag over a block.
Attach an if block from the Control groups below this.
From the Sensing category, drag a sensor ()? block to the condition space. Set it to A connected using the drop-down menu.
Drag two say () for () secs blocks to the script area and change the text as shown here:
Drag the two blocks from step 4 into the corresponding area shown here:
Now run your program, testing at least once for having the clips connected and at least once not having them connected.
There's more…
You might be wondering right now how useful this recipe is. To make...