Milestone 6: Creative Project
Table of contents
Overview
Now that you have completely implemented the laser tag game, do something fun and interesting with your system. This milestone will be accomplished as a team. Here is how it works.
- M6 Creative Proposal: Submit a short proposal (2-3 sentences is plenty) via Learning Suite. The proposal will be reviewed to make sure it is not too difficult or too easy. Once approved, a score for this assignment will be entered into Learning Suite for each member of your team.
- M6 Report (Video): Submit via Learning Suite your approved proposal text (2-3 sentences) and a link to a short video (2-3 minutes) demonstrating your proposed features. All members of the team are expected to participate in the production of the video.
When submitting an assignment, please use the Submission Notes in Learning Suite to paste your proposal text and a link to your video. Upload your video to YouTube, Google Drive, Box, etc. Do not upload the video file (.mov .mp4) directly to Learning Suite. Make sure your video link is publicly viewable.
Your team is on the hook to achieve what you proposed, so start early! I can’t help you with bugs or problems if you leave this until the end of the semester. If you can’t get your project to work at all, it will be very difficult to offer much in the way of partial credit.
Video Grading
In most cases, a well-edited video of no more than 2-3 minutes should be adequate.
Here is the grading rubric for your video:
- Overall quality of the video. Please edit your video and make it a quality presentation: 25%.
- Demonstration of proposed features, i.e., do you demonstrate the functionality of everything that you proposed to do?: 50%.
- Creativity and novelty of your video presentation, i.e., is your video interesting and engaging?: 15%.
- Entertainment value, i.e., is your video fun to watch?: 10%.
Appendix
This appendix contains additional information that may be helpful in the design and implementation of your creative project.
Custom Sounds
If you have a custom sound in the form of an audio file that you want to use in your project, it will need to be converted to an array of values in a “.c” file. Follow the instructions below to integrate a custom sound clip with your application.
Identify a sound clip or record your own as an audio file. Compatible file types are: (.aifc .aiff .aif .au .flac .ogg .opus .mp3 .m4a .mp4 .wav). Ideally, the clip should be under a second or two in length. This online voice recorder can create a “.wav” audio file.
Place the audio file in the audio directory of your personal repository (e.g., ecen390/audio).
Use the MATLAB script audio/audio2ci.m to convert your audio file to a “.c” file. The generated “.c” file defines an array of data samples that can be compiled for use with the application code. A corresponding header (.h) file will also be generated. If you look at the source to audio2ci.m, you will notice that the output sample rate is 32 kHz and that the output sample size is 16 bits.
- Open a terminal window and change (cd) to the audio directory.
- Run MATLAB by typing
matlab
from the command prompt. - From within MATLAB, open the audio2ci.m script and run it.
- Select your audio file from the popup dialog.
After running the script, move or copy the output files from audio/c32_16b to ltag/components/c32_16b. Remember to include the header files in your project code where you call the sound functions.
Build your application and download it to the tag unit. Verify that your sound plays correctly. The sound should be the same as when playing the original audio file on another device. It should not play at a different pitch or speed.
Wi-Fi
The ESP32 has builtin hardware support for Wi-Fi. Several networking APIs are available for use in your application. Most likely, the simplest path to connecting laser tag units is to use the ESP-NOW library and protocol. References are given below to get you started.
To make networking with Wi-Fi even simpler, a net component is provided in your starting code along with a working example that you can run on your laser tag units. The net component is essentially a thin wrapper around the ESP-NOW library. See the comments in net.h for more detail about each function.
- components/net/net.h
- components/net/net.c
- test_net/main/main_v2.c
Bluetooth
The ESP32 also has builtin hardware support for Bluetooth. However, a sophisticated stack of software is needed to utilize the Bluetooth capability. References are given below to get you started. Using Bluetooth in your project will require some amount of bushwhacking. The TAs (and instructor) will not likely have pioneered a solution specific to your project. Nevertheless, we are happy to help where possible. The nRF Connect scanning and exploration tool for mobile phones is a great app for testing and debugging.
If you are trying to communicate over Bluetooth with a small, external device from your laser tag unit, the Adafruit Bluetooth UART module might provide a solution. Communication with the module is simple; characters sent to the UART are transmitted wirelessly via Bluetooth and vice versa for receive. Adafruit also has a mobile phone app that can connect with their module or a properly configured ESP32.
Accessing Additional Pins
Not all of the pins on the ESP32 module are in use. Several GPIO pins are available for use in your creative project. See the Laser tag digital board schematic for more detail.
Not enough time remained before the start of the semester to add break-out connections for unused ESP32 GPIO pins to the laser tag digital board. If you try to solder jumper wires onto the surface-mount pins of the ESP32, the risk is high for damage to your digital board. If you want to use the unused GPIO pins this year, it will take some fine wire, a steady hand, and some exceptional soldering skills!