Sensing the World – Motion

Sensing the world – Motion!

In this lesson, students will learn about Motion sensor and how to deal with is using BrainPad Arcade


Target Audience

Anyone 13+ will benefit from this series. Younger audiences can still follow along when paired with an adult. An example can be a pops/grandchild STEM weekend event!

Setup

You will need any computer with a modern internet connection. Windows, Mac, and even Chromebook will work!

Having a BrainPad Arcade will help you understand the Edge connectors, take the game you made, and load it on a device you are holding. You will need some sensors from the BrainClip kit, And you need to finish the previous project from here.


Virtual Smart Door!

when you go through a mall door, the door will automatically open, like when you enter an elevator.

how do these doors open? let’s create our “Virtual Smart Door”, using Motion Sensor and BrainPad Arcade

First, let’s draw a door in our Arcade screen, we will use two sprites, Door1 and Door2, and move it when the motion sensor detects a motion! we can use the “Change scale” to make it bigger.

Now, we need to connect our Motion sensor to the Arcade.

Connect “GND” from the sensor to “GND” at the Arcade, and “VCC” from the sensor to the “3V” at the Arcade.
Finally, choose a pin to control it, we connect “OUT” from the sensor to PIN0 at the Arcade

Now, we will program the sensor, using “digital read” If the sensor reads a motion will give us “true” to open the door, or “false” to keep the door closed.


What next?

Try to connect the sensor with one of the games, that moves the sprites when sensing a movement around the sensor.

Content Licensing
Newsletter

Twitter Feed
Hot off the press!