casychow / DesktopPet_Eui

A small, mobile desk robot that helps alleviate the physical, emotional, and mental problems frequently faced by desk workers. This is my NYU Tandon Senior Design Project.
0 stars 0 forks source link

testing sound subsystem #13

Closed casychow closed 3 years ago

casychow commented 3 years ago
casychow commented 3 years ago

Qin Ying and I tested the code by looking at documentation of piezo buzzers. First we ensured both piezo buzzers could power on. We first tried to make one buzzer make a continuous sound in a python file using a regular GPIO pin. However, changing regular GPIO pins to an out mode did not work. Instead, we tried using PWM GPIO pins. Using the PWM documentation (listed below), we were able to play a sound from the piezo buzzer. We also tested the same code using the other piezo buzzer. Afterwards, we coded the playMelody(). Qin Ying coded the melody for London Bridge whereas Cassandra coded the foundation for the playMelody() function.

Some links: https://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds/playing-a-scale http://www.linuxcircle.com/2015/04/12/how-to-play-piezo-buzzer-tunes-on-raspberry-pi-gpio-with-pwm/ https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/

We tested each other's code and tested both our piezo buzzers with the same code.

Qin Ying, in order to create playMelody(), coded London Bridge, as shown in the video: https://drive.google.com/file/d/1OE9rkIKud_Cttsw57SQjcFcXfKjOyFQT/view?usp=sharing