using sound with arduino | women hardware hackers atx, november 2015
TRANSCRIPT
Using Sound with ArduinoWomen Hardware Hackers | November 2015
Sharon Cichelli
Adafruit Project: Ursula's Seashell Necklace
https://learn.adafruit.com/ursulas-seashell-necklace/
Keep in Touch
Sharon Cichelli
womenhh.slack.com
girlwritescode.com
lostechies.com/sharoncichelli
slideshare.net/girlwritescode
@scichelli
Warm-Up Projects
Play a toneconnect a speaker
tone() function
#define to give good names (or const for safety)
pitch
for loop
Interactive buzzermap() function
Serial monitor
WAV filelibrary
pull-down resistor
Audacity
again: Serial monitor
Ursula's Seashell Necklace Project
Audio inputagain: library, map() function
instantaneous function for sensitivity
peak clipping
noise cancelling
Code conceptsdatatypes
ternary operator
bit shift operator
Wikipedia for C and C++ Operators
Visual displaySPI for NeoPixel (serial again, like the monitor)
CHSV for mapping to color
https://learn.adafruit.com/ursulas-seashell-necklace/
Play a Tone
• connect a speaker
• tone() function
• #define to give good names (or const for safety)
• pitch
• for loop
https://github.com/scichelli/Arduino-Sketches/blob/master/SoundExamples/speaker/speaker.ino
Interactive Buzzer
• map() function
• Serial monitor
https://github.com/scichelli/Arduino-Sketches/blob/master/SoundExamples/buzzer/buzzer.ino
WAV file• library
• pull-down resistor
• Audacity
• again: Serial monitor
https://github.com/scichelli/Arduino-Sketches/blob/master/SoundExamples/rickroll/rickroll.ino
Ursula's Seashell Necklace
Adafruithttps://learn.adafruit.com/ursulas-seashell-necklace/
• Audio input• again: library, map() function• instantaneous function• peak clipping• noise cancelling
• Code concepts• datatypes• ternary operator• bit shift operator• C and C++ Operators
• Visual display• SPI for NeoPixel• CHSV
https://learn.adafruit.com/ursulas-seashell-necklace/the-code
Summary
Today's Topics
• Simple speaker, built-in tone() function
• Use map() to transpose one range onto another
• Libraries and shields give extra capabilities
• Pull-down resistors make inputs more reliable
• Microphones read voltages, which must be amplified and offset to be read
• Look up unknown code punctuation in a list of C and C++ operators
Future Topics
• Schematic breadboard➡
• Breadboard schematic➡
• Bit-wise operations and binary numbers
• Keeping track of your work with source control
• Pull-down (and pull-up) resistors
• Pulse-width modulation (PWM)
• More sensors: infrared, light, piezoelectric...
• Wearables and paper circuits
Image Backup