element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
microbit
  • Learn
  • Learning Center
  • STEM Academy
  • microbit
  • More
  • Cancel
microbit
micro:bit Blog [PROJECT] BBC Micro:bit V2 – Accelerometer Theremin  – PORTING of version 2 by Cabe
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
microbit requires membership for participation - click to join
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Catwell
  • Date Created: 1 Jun 2021 4:59 AM Date Created
  • Views 2315 views
  • Likes 2 likes
  • Comments 1 comment
  • microbit v2
  • theremin
  • project
  • microbit
  • diy
  • cabeatwell
  • sound
  • music
Related
Recommended

[PROJECT] BBC Micro:bit V2 – Accelerometer Theremin  – PORTING of version 2 by Cabe

Catwell
Catwell
1 Jun 2021

image

 

I finally received a Micro:bit V2!!! My first projects with the V2 is going to be porting some of my old V1 projects over to it, and make them work.

 

All the projects I did that required an external microphone and speakers on the V1 should be a breeze to port. Or so I think…

 

First project up is the “Accelerometer Tone Adjuster and Microsynth Case” project I did on the V1. I’m dropping the Microsynth case for this build since it’s just gluing the board in. Not exactly that technical for me to show.

What seems a bit different is the smoothing of the output signal with Micro:bit V2. It’s a super smooth tone this time. Of course, you can turn the signal smoothing off by setting a value to “False” in the code. See the code comments for more on that.

 

The software works as follows:

- Power it up.

- Press and hold “B” on the Micro:bit V2

- Move the Micro:bit around to hear the sounds change.

 

First, let’s gather all the necessary components you’ll need to build this project.

1x BBC Micro:bit V2

1x 5v 2A power supply

 

Video demonstration of the project:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

STEP 1

Load the code onto the Micro:bit V2.

I am providing the hex file you need to drag and drop onto the Micro:bit V2, and the python code as two separate files. For the below process, just use the hex file.

Plug the MicroUSB cable into the Micro:bit V2, and plug the other end of the cable to a PC or MAC.

At this point, you are going to copy over the code to the Micro:bit V2. I am providing the program (code) in this post that needs to be copied over. When the Micro:bit V2 plugs into a computer, it shows up as a USB flash drive. All you have to do is copy the file over to the Micro:bit V2, like it’s a USB Flash Drive, and the Micro:bit V2 will reset, and the program is active.

You can remove the Micro:bit V2 from the computer at this point. The program will start running, and without the rest of the circuit, it will not function.

●

A little bit about the code:

The biggest change is the way sound is output. This time, I do not address an analog pin but “pin_speaker,” which was super nice. Read more about this change with Micro:bit V2 here.

image

 

See the code comments for every section.

 

 

STEP 2

Look at this… zero wiring this time! Micro:bit V2 adding a built in speaker was genius! So, it’s essentially “plug it in and let the fun begin.”

- Power it up.

- Press and hold “B” on the Micro:bit V2

- Move the Micro:bit around to hear the sounds change.

 

 

Conclusion:

To this was fairly straight forward. After adding the necessary changes for the speaker output, there wasn’t much else to change. A very smooth port.

 

More ports to follow soon. image

  • Sign in to reply
  • Rando
    Rando over 2 years ago

    Am I missing the updated link for the new version of the code that works with the Micro:Bit v2 ...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube