Skip to main content

Dozuki Update 8/24

Minor Versionm

by Alan

Introduction

Learn how to use the sound sensor onboard the Circuit Playground Express! This tutorial uses MakeCode, which is an easy-to-use code writing program!

  1. To start using a Circuit Playground, you'll need a laptop, a circuit playground, and a USB cable
    • To start using a Circuit Playground, you'll need a laptop, a circuit playground, and a USB cable

    • If you've never used makecode before, check out this tutorial to learn about it

  2. Ignore the forever loop that is already there, it'll be used later. Place an on start loop in the workspace.
    • Ignore the forever loop that is already there, it'll be used later.

    • Place an on start loop in the workspace.

    • Inside the on start loop, place a set all pixels to... block. Change the color to black

    • This doesn't turn the pixels fully off, but rather makes it so they don't emit any light!

    • Place a set brightness block inside the loop as well. Change the brightness to whatever you'd like

    • Finally, add a set loud sound threshold block. This will determine how loud a sound has to be to turn the lights on. Change the threshold as you see fit.

  3. Drag out an on loud sound block from the input menu
    • Drag out an on loud sound block from the input menu

    • Inside the block, add a set all pixels to followed by a pause block. Change the duration of the pause to at least 500 ms.

    • After the pause, insert another set all pixels to block and change the color to black

    • Plug the circuit playground into your laptop using the usb cable

    • Download your code and follow the instructions in MakeCode to write the code to the board

  4. For the challenge, try writing the code so that the leds are on when the volume is above a certain level You'll need a forever loop, an if...else logic loop, a comparison statement, and the sound level from the input menu
    • For the challenge, try writing the code so that the leds are on when the volume is above a certain level

    • You'll need a forever loop, an if...else logic loop, a comparison statement, and the sound level from the input menu

    • You can use the interactive volume slider to test your code before writing it to board. Click and drag to change the volume of the sound

Quiz:

Circuit Playground Sound Sensor: Quiz

Kate Cheville

Member since: 05/15/2024

9 Guides authored

0 Comments

Add Comment

View Statistics:

Past 24 Hours: 0

Past 7 Days: 0

Past 30 Days: 8

All Time: 24