diff --git a/code/project/README.md b/code/project/README.md index 1dc92cf..b82cc4a 100644 --- a/code/project/README.md +++ b/code/project/README.md @@ -1,43 +1,75 @@ # micro-tuner -An instrument tuner assistant, designed to be run on the Microbit V2. Portable and Practical! +An instrument tuner assistant, buit to be run on the Microbit V2. Portable and Practical! ## Background +Selecting a project for this course was itself small challenge and lead to a slightly later start then I would have otherwise planned. +### Alternatives +Since I thought a lot about it, I may as well mention what the alternatives may have been +* Reverse engineering, or augmenting the firmware of my [DEFCON30 badge](./defcon.jpg) +* Adding sound output capabilities to my recent [BSides badge](./bsides.jpg), possibly with my [piezoelectric buzzer](./buzzer.jpg) (discussed briefy in the notebook) +* An undetermined project, perhaps reverse engineering or adding to a small [FM receiver](./fm-tuner.jpg) board I have, but know little about (Chip MEGA328P) +* Sound oriented project involving other small devices I own like arduinos, raspberry pi's, and my newly aquired adafruit featherboard RP2040. Notably, the new Pi 5 no longer has a 3.5mm audio port, and it would be interesting to try to build a DAC in code with GPIO output, to not need an external USB DAC. +* Understanding/Experimenting with sound tricks like [Dolby Pro Logic](https://en.wikipedia.org/wiki/Dolby_Pro_Logic) +* Buying an SDR and exploring the various ways sounds is encoded and transmitted in practical radio applications. Learning the law, and getting an amateur radio license -### Primary Goals (VIP) -* +I hope to work on many of these some day soon, but feel free to share these with any future students looking for ideas + +### Decision +I chose to create an instrument tuner device with my microbit-v2 from the previous embedded rust course. Compared to the other ideas, this project is both tangible and flexible. It can be broken into different levels of goals and there are different layers of abstraction I can choose from with this approach. + +## Goals +### Primary Goals (MVP) +* The microbit shall be able to play any reference note. The reference note will be displayed on the LED matrix, and the touch button shall play the note when touched. The A and B buttons will allow the choosing of different reference notes. +* In an alternative mode, the microbit shall be able to identify the note heard by the microphone. Likewise, this note should also be displayed +* Portable / can run on a battery (this should just work) ### Stretch Goals -* +* In the identify mode, if the note heard is close to a reference note, some feedback should be given (up or down arrow, etc.) + * Building on the above point to set a "target" note and provide appropriate feedback +* Avoid whatever sound+music abstraction the microbit package provides and build/interpret my own frequencies -### Fun, less realistic ideas -* +### Fun ideas (Stretch ++) +* Interfacing with the dragontail and breadboard to do some cool stuff: + * Using the analog dial resistor to assist with chaning notes + * Using an external LED for more interesting feedback + * Printing some data to an external display + * Interfacing some pins to a USB adapter -> MIDI adapter -> My MIDI keyboard, to instantly choose a reference note +* Parallel implemention in rust, and comparing the performance ## Source Code Overview +Although I already have experience interfacing with the various capabilities of this device with rust, I decided to go with python for this project. I want to compare the experience of both, and also have the ability to take advantage of more abstractions if I choose to. - -### `src/ex` -Lorem Ipsum -* 1,2,3 - - +### [`main.py`](main.py) +TODO ## Building/ Running +It seems that many python microbit developers use a highly abstracted web-based IDE. I attempted to avoid that. These methods are tested only on my local debian-based linux machine, so your results may vary +### Dependencies +```bash +pip install microbit-3 +pip install uflash +``` +### IDE support +The microbit package does not seem to include the necessary stubs/tooltips for graceful IDE development. I found the [micro:bit Python](https://marketplace.visualstudio.com/items?itemName=MAKinteract.micro-bit-python) VS Code extension helpful. Follow its instructions +### +```bash +uflash main.py # Optional paramter for device port like /dev/ttyACM0 if not found automatically +``` +### Serial (for console output) +```bash +screen /dev/ttyACM0 115200 # You may have a different port +``` ## Testing - -### Manual End-to-End tests - -#### Client side end-to-end - +TODO ### Coded Unit tests - +TODO ## Demo - - +TODO ###### Author: David Westgate \ No newline at end of file diff --git a/code/project/bsides.jpg b/code/project/bsides.jpg new file mode 100644 index 0000000..4436d81 Binary files /dev/null and b/code/project/bsides.jpg differ diff --git a/code/project/buzzer.jpg b/code/project/buzzer.jpg new file mode 100644 index 0000000..45d1a86 Binary files /dev/null and b/code/project/buzzer.jpg differ diff --git a/code/project/defcon.jpg b/code/project/defcon.jpg new file mode 100644 index 0000000..f379aa4 Binary files /dev/null and b/code/project/defcon.jpg differ diff --git a/code/project/fm-tuner.jpg b/code/project/fm-tuner.jpg new file mode 100644 index 0000000..f5ef740 Binary files /dev/null and b/code/project/fm-tuner.jpg differ