mirror of
https://codeberg.org/eel4746_piano/avr_piano.git
synced 2024-11-25 02:30:30 -05:00
3.0 KiB
3.0 KiB
Notes
Plan
- Test speaker without Arduino
- can be done by using a function generator and 3.3V square wave with variable frequency
- Write AVR C code to generate a square wave of varying frequency via Timer1
- Timer1 is used so that a pre-scalar and its calculations don't need to be done
- Use a table/array that stores frequencies and the indices correspond to the buttons on the sound board
- Create buffers to add recording/saving/playing functionality
- the buffers are a sequence of notes (which are the indices of the previous table) that is terminated by some other byte
- Figure out how the LCD in the starter kit is programmed
- we did this in lab 10 on April 10 and are allowed to use that code
- Show the current and surrounding notes in the currently selected buffer (or the note of the soundboard button that was just pressed)
- Add a menu on the second row to select the memory buffer (maybe 1-5)
- it is controlled by left and right buttons
2024-03-28
2024-03-30
- the speaker was tested with a function generator (from the EspoTek Labrador) outputting a square wave of varying frequency
- it is painful above a frequency of 12 kHz and just creates clicks below 30 Hz
- it is louder at certain frequencies and quieter at others, and this is not a linear relationship
- the speaker's datasheet has a graph of this which can be used to adjust the speaker's volume at the problematic frequencies
2024-04-03
- other speakers sold on DigiKey have more stable frequency response graphs where the volume does not fluctuate very much compared to the speaker included in the kit
- those speakers however use sine waves instead of square waves, so our first step should be focused on figuring out how to send sine waves at certain frequencies, perhaps with fast PWM
2024-04-09
- Asked Sam how to use PWM to handle no use of DAC.
- Test the new speaker on Friday without DAC to see if it sounds okay enough.
- Lets Try and talk to Rashid or other EE professors.
- I think we should also try and get a DAC from the Lab!
- We looked into how to use the shift register to handle the fact that we have to many buttons for the pins on the Uno.
- We can ask same for a shift register.
- We looked into how to use the LCD display and got some Pseudo code from GPT to help.
2024-04-12
- tested new speaker and it works very well with square waves
- so sine waves via Fast PWM+RC filter no longer needs to be done
- soldered speaker to a solderboard
2024-04-13
- started working on the project's poster
2024-04-14
- since we don't know if we can even get the shift registers on time, it's possible to make our own via another Arduino that has all the buttons connected to it and it sends the data over USART to the speaker Arduino
- the length of each note can be saved as how many cycles of the square wave note were generated, perhaps with a prescalar if it's a really long and high frequency note