Friday, November 6, 2026
Home3D PrintingA easy audio participant for SAMD21G-based microcontroller boards #Music @MicrochipMakes « Adafruit...

A easy audio participant for SAMD21G-based microcontroller boards #Music @MicrochipMakes « Adafruit Industries – Makers, hackers, artists, designers and engineers!

[ad_1]

Oscar den Uijl has created a easy (however oversampling) audio participant for SAMD21G-based Arduinos.

Mainly, this library allows you to ship an array of 8-bit samples to the DAC on pin A0, with non-compulsory extrapolation aka oversampling.

I’ve related the output pin via a 2.2μF capacitor and a 1kΩ resistor in sequence to a small and low-cost energetic speaker set such as you would use for a pc. It additionally appears to work tremendous once I join it to the AUX enter of the sound thingy on my laptop.

Notes:

  • Performs 8-bit samples in mono solely. Extrapolation aka oversampling can be utilized to enhance the output.

  • Makes use of GCLK3 and TC4, impacts TC5.

  • The values of the capacitor and resistor I exploit haven’t been calculated; they only occurred to be those mendacity round inside attain and their values appeared shut sufficient for this.

  • Sound high quality could enhance a bit if you happen to add a low-pass filter to eliminate the “steps” within the output. Extrapolation does make them smaller, however they’re nonetheless there.

  • When you’ve got an Arduino 33 IoT, taking part in the sound with the instance will begin whenever you faucet your breadboard, or hit your desk (Tilt!). Different Arduinos will simply loop the pattern with a brief pause in-between (I hope).

  • The instance will load very slowly within the Arduino IDE, as a result of there’s a massive pattern array in it, and the Arduino IDE isn’t superb at loading massive applications shortly.

  • Solely examined on the Arduino Nano 33 IoT, and that is an early model; YMMV.

See extra on GitHub.

Cease breadboarding and soldering – begin making instantly! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and extra. Construct initiatives with Circuit Playground in a couple of minutes with the drag-and-drop MakeCode programming web site, study laptop science utilizing the CS Discoveries class on code.org, bounce into CircuitPython to study Python and {hardware} collectively, TinyGO, and even use the Arduino IDE. Circuit Playground Categorical is the latest and finest Circuit Playground board, with help for CircuitPython, MakeCode, and Arduino. It has a robust processor, 10 NeoPixels, mini speaker, InfraRed obtain and transmit, two buttons, a change, 14 alligator clip pads, and many sensors: capacitive contact, IR proximity, temperature, gentle, movement and sound. An entire huge world of electronics and coding is ready for you, and it suits within the palm of your hand.

Be part of 30,000+ makers on Adafruit’s Discord channels and be a part of the neighborhood! http://adafru.it/discord

Have an incredible venture to share? The Electronics Present and Inform is each Wednesday at 7pm ET! To affix, head over to YouTube and take a look at the present’s dwell chat – we’ll submit the hyperlink there.

Be part of us each Wednesday evening at 8pm ET for Ask an Engineer!

Comply with Adafruit on Instagram for high secret new merchandise, behinds the scenes and extra https://www.instagram.com/adafruit/

CircuitPython – The simplest approach to program microcontrollers – CircuitPython.org

Get the one spam-free day by day publication about wearables, working a “maker enterprise”, digital ideas and extra! Subscribe at AdafruitDaily.com !

No feedback but.


Adafruit has a “be glorious to one another” remark coverage. Assist us maintain the neighborhood right here optimistic and useful. Persist with the subject, be respectful of makers of all ages and talent ranges. Be form, and do not spam – Thanks!



[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments