Uses the Scratch programming language

A Wireless Controller for a Scratch Game

Submitted by DaveBakker on Tue, 04/10/2018 - 02:36

Let's create a game in Scratch that is controlled by a wireless controller using the PocketLab accelerometer. PocketLab can connect directly and wirelessly to Scratch, and can send sensor data in real time. This game uses the PocketLab accelerometer to move sprites around the screen.

This program is for intermediate or advanced Scratch users, and if you would like a simpler starting point to get started with connecting Scratch to the outside world through PocketLab, you can start here:

Programming with Sensors in Scratch

Submitted by DaveBakker on Sun, 04/08/2018 - 05:18

This lesson will show you programming in Scratch with external sensors. We can read sensor data directly into Scratch and use it to write programs that make decisions based on what the sensors are measuring. If you need a quick primer on Scratch programming, go to this link. There are plenty of resources to get you started.

Scratch and PocketLab Space Blaster game

Submitted by DaveBakker on Tue, 03/06/2018 - 00:03

Download the Scratch .sbx file for a Space Blaster game you can play with Scratch and PocketLab. Works with PocketLab One and Voyager. 

Instructions to run ScratchX and the PocketLab web app are here.

The Space Blaster game is also featured in our PocketLab and Scratch STEM Coding Challenge - see attached pdf file for complete programming guide.

A Lesson in Radioactivity and Half-Life: Voyager/Scratch Geiger Counter Simulation

Submitted by Rich on Tue, 02/20/2018 - 21:10

This lesson makes it possible for your students to study radioactive decay and half-life concepts without the need to purchase expensive radiation monitors and actual radioactive isotopes.  Scratch and Voyager work together to accomplish this via a simulation that matches that of true radioactive decay.  ScratchX is not required, but may be used.  The Scratch program provides the decay process.  With each decay of a simulated atom, the Scratch screen quickly flashes white and emits a beep sound similar to that of a typical Geiger counter.  Voyager’s light sensor records each of the decays a

True Random Numbers in Scratch

Submitted by DaveBakker on Fri, 02/16/2018 - 01:06

We can create a way to make true random numbers in Scratch using the PocketLab Voyager's light sensor and a lava lamp. Sounds crazy? Not really, there is actually a US patent for such a system! It turns out that on their own, computers are not good at generating true random numbers, therefore to make true random numbers using a computer you need an external source of randomness.

A Lesson in Probability and Statistics: Voyager/Scratch Coin Tossing Simulation

Submitted by Rich on Wed, 02/14/2018 - 19:25

This lesson introduces students to a variety of probability and statistics concepts using PocketLab Voyager and Scratch—ScratchX is not required.  The Scratch program simulates tossing any number of coins any number of times, displaying the number of heads in each toss with a square having varying shades of grey—black for zero heads and white for the maximum possible number of heads in each toss.  The simulated coins are tossed once each second with Voyager’s light sensor recording the results for each toss.

Six Shades (not fifty!) of Grey: PocketLab Voyager/Scratch Dice

Submitted by Rich on Tue, 01/16/2018 - 22:20

This is a programming project that capitalizes on PocketLab-Scratch Integration.  This project makes use of the Scratch random number block to simulate rolling an ordinary six-sided die.  The six random but equally likely outcomes are mapped to sprites of six different shades of gray.  Voyager’s light sensor is then used to determine the value of the die’s roll, mapping light sensor values to the corresponding sprite from six images of the face up side of the die.  A short action video of the author’s solution accompanies this lesson. 

Programming Exercise:Voyager Temperature Probe Controlled Scratch Teapot

Submitted by Rich on Fri, 12/29/2017 - 01:16

Here is a project that will challenge your students’ skill in interfacing PocketLab Voyager with Scratch Programming.  The challenge is to program the five bubbles to start bubbling upwards in the teapot—one bubble at 90ᵒC, two at 92ᵒC, three at 94ᵒC, four at 96ᵒC, and five bubbles at 98ᵒC.  When the temperature of the teapot has reached 100ᵒC, the phrase Full Boil should appear.  See the movie accompanying this lesson for clarification of the intended result.  When the burner under the real teapot is turned off and cooling begins, bubbling should go away in revers

Programming Exercise: Voyager Light Sensor Drives a Scratch Program of the Eye

Submitted by Rich on Sun, 12/10/2017 - 22:01

The eye is one of the many marvels of the human body.  The colored iris of the eye, surrounding the pupil, acts as a diaphragm to keep the amount of light entering the eye fairly constant.  If you walk out the door of your house to a sunny yard, the iris opening gets smaller letting less light into your eye.  If you enter a dark room after watching your favorite television program, the iris gets larger to allow more light to enter your eye.  This is a protective reflex, as too much light could damage the retina, which is where the image forms in the eye, similar to the film of a traditional