Code & Circuit has developed this ScratchX Extension to control our EV3 bricks over Bluetooth from Scratch.
Check out the demo video below.
Try it out!REQUIREMENTS:
- An EV3 brick
- A properly configured ScratchX device plug-in on Mac (Safari) or Windows (IE or Firefox)
- Make sure you have installed the latest Device Plugin for Safari or IE.
- First-Time Setup:
- In our classroom, we've paired each brick with its own laptop. The bricks and laptops are labeled with numbers, and students match the numbers before starting.
- Mac-specific step (skip if on PC):
- The brick must first be re-named starting with the string "serial" (in lowercase) before pairing so that Scratch will recognize it. Re-name a brick by connecting it to the Mac via USB, and using the LEGO Mindstorms Mac software. You should see the name change on the brick’s title bar.
- If you previously paired the brick before renaming it, follow these steps before pairing:
- Turn off Bluetooth on the Mac (in the BT prefs).
- Trash /Library/Preferences/com.apple.Bluetooth.plist (this is the main Library, not the user Library.)
- Reboot the Mac
- Re-enable Bluetooth.
- Follow the next step to pair the brick.
- On the Brick, enable bluetooth if it’s not already enabled.
- On the Brick, select the "iPhone/iPad/iPod” checkbox. (only temporarily; we’ll turn this off in the last step.)
- Look for the brick in the computer's Bluetooth panel, and click Pair. You should not be asked about passcodes. (Checking that iPhone/iPad/iPod for some reason eliminates the passcode requirement.)
- During pairing, you’ll see the brick show up as connected to the computer for about 5 seconds and then disconnect. This is normal. Wait for it to disconnect before the next step.
- Lastly, turn off that "iPhone/iPad/iPod” checkbox.
- You should not have to do these steps again, unless a brick crashes hard and does a full reset. If you notice the brick's name has reverted back to "EV3", it may have to be renamed and repaired.
- Using the Extension:
- Make sure brick is powered on first and iPhone/iPad/iPod checkbox is unchecked.
- Do not manually initiate any connections to or from the brick. The Scratch Plug-in will automatically connect when the ScratchX webpage loads.
- Go to this link using Safari (Mac) or IE (Windows): EV3 Scratch Extension. We have not had any luck with Chrome.
- When the connection is successful, you will hear the brick play some happy tones.
- If the connection is lost (brick was turned off, goes out of range, etc.), you must refresh the browser page to re-connect to the brick. Save your ScratchX project as an sbx file first, refresh the page, wait for the beeps, and then load the sbx file.
- Make sure the brick is turned on before going to the ScratchX webpage link.
- You can double-click a block directly in the menu in Scratch to make it trigger immediately. For example:
- To test whether a brick is connected, double-click the "play tone" block in the More Blocks menu. You should hear a tone!
- To stop all motors quickly, double-click the "stop all motors" block.
- To see the value of a sensor, double-click its rounded block to see the result in the little pop-over.
- Make sure your EV3 blocks have selected the correct motor or input port.
- For the IR Remote block to work, the red slider on the remote must be switched to top (1) setting. On the block, select the port where the IR sensor is connected.