This shows you the differences between two versions of the page.
milestone_6 [2023/03/30 11:58] scott [Milestone 6: Creative Project] |
milestone_6 [2023/04/10 10:57] (current) scott [Custom Sounds] |
||
---|---|---|---|
Line 29: | Line 29: | ||
==== Custom Sounds ==== | ==== Custom Sounds ==== | ||
- | If you have a custom sound in the form of a WAV file that you want to use in your project, it will need to be converted to an array of values in a C file. Look in the lasertag/sounds directory for existing examples. | + | If you have a custom sound in the form of a WAV file that you want to use in your project, it will need to be converted to an array of values in a C file. Look in the lasertag/sound directory for existing examples. |
* One option is to use [[https://colinjs.com/software.htm#t_WAVToCode|WAVToCode]] to convert your WAV file to C code. It is a Windows application, so you will need to find a Windows machine to run it. | * One option is to use [[https://colinjs.com/software.htm#t_WAVToCode|WAVToCode]] to convert your WAV file to C code. It is a Windows application, so you will need to find a Windows machine to run it. | ||
- | * Another option is to compile the [[https://github.com/byu-cpe/ecen330_student/blob/master/lasertag/sounds/wav2c.c|wav2c.c]] source code and run it from the command line. You can use [[https://www.audacityteam.org/|Audacity]] to edit and prepare your WAV files before converting them to C code. | + | * Another option is to compile the wav2c.c source code (in the sound directory) and run it from the command line. This program expects a single-channel (monophonic) PCM format WAV file as input and will produce C code as output. If your WAV file is stereo, you will need to convert it to monophonic before using wav2c. You can use [[https://www.audacityteam.org/|Audacity]] to edit and prepare your WAV files before converting them to C code. |
- | You are free to modify [[https://github.com/byu-cpe/ecen330_student/blob/master/lasertag/sound.c|sound.c]] to integrate your custom sound. | + | You are free to modify sound.c (in the sound directory) to integrate your custom sound. |
---- | ---- | ||
Line 40: | Line 40: | ||
==== Bluetooth Modem ==== | ==== Bluetooth Modem ==== | ||
- | The Bluetooth modem is connected to the ZYNQ FPGA via a fixed-rate 9600 BAUD modem. Communication with the modem is simple enough: characters pushed out the Bluetooth UART are transmitted via the Bluetooth modem and vice versa for receive. I have included documentation for the UART below. There is a bluetooth directory in the lasertag directory that contains source code that shows how to communicate with the bluetooth modem. The provided example program ([[https://github.com/byu-cpe/ecen330_student/blob/master/lasertag/bluetooth/main.c|main.c]]) is simple. It receives characters from the bluetooth modem, converts them to upper case and then echos the converted characters to the phone. You use the provided Adafruit Bluefruit Connect App, which is available for both IOS and Android. I have provided links to the documentation below. There is additional information in the [[https://github.com/byu-cpe/ecen330_student/blob/master/lasertag/bluetooth/README.txt|README.txt]] file contained in the bluetooth subdirectory contained in the lasertag directory. You can build and test the provided code by uncommenting one line in the lasertag CMakeLists.txt file. | + | The Bluetooth modem is connected to the ZYNQ FPGA via a fixed-rate 9600 BAUD modem. Communication with the modem is simple enough: characters pushed out the Bluetooth UART are transmitted via the Bluetooth modem and vice versa for receive. I have included documentation for the UART below. There is a bluetooth directory in the lasertag directory that contains source code that shows how to communicate with the bluetooth modem. The provided example program (main.c) is simple. It receives characters from the bluetooth modem, converts them to upper case and then echos the converted characters to the phone. You use the provided Adafruit Bluefruit Connect App, which is available for both IOS and Android. Links to the documentation are provided below. There is additional information in the README.txt file contained in the bluetooth subdirectory contained in the lasertag directory. You can build and test the provided code by uncommenting one line in the lasertag CMakeLists.txt file. |
* [[https://www.adafruit.com/products/2479|Adafruit Bluetooth Modem Info]] | * [[https://www.adafruit.com/products/2479|Adafruit Bluetooth Modem Info]] | ||
* {{::pg142-axi-uartlite.pdf|Xilinx UART Lite Documentation}} | * {{::pg142-axi-uartlite.pdf|Xilinx UART Lite Documentation}} |