An audio demonstration using MicroPython, the PyBoard and its AMP Skin.
For a discussion of the application and its development refer to my EuroPython presentation in Rimini (July 2017) or PyConUK in Cardiff (October 2017).
You need good soldering skills to build the AMP skin.
Once built you'll be able to access the speaker
using DAC port 1
and the microphone via the ADC on X22
.
The code's been tested with:
- PyBoard v1.1
- Audio Skin v1.0
- MicroPython v1.9.2
Remember to always correctly eject the PyBoard from your workstation. If you do not you can corrupt files on Board.
If you need to update your PyBoard firmware first disconnect it from your workstation and, if attached, remove the audio skin. You can then Update your PyBoard firmware and then re-connect the audio skin before re-connecting the PyBoard to your workstation.
When connected the PyBoard should appear as a USB flash device
(probably called PYBFLASH
).
Copy main.py
and PyBdEcho.py
from the PyBdEcho project
to the root of the device, replacing the files that are there if you need to.
Wait for the PyBoard RED LED to extinguish (it takes a few seconds) and then
hit the board's RST
button.
If all's gone well after rebooting the RED LED will extinguish after a few seconds and the GREEN LED should be slowly toggling (with a period of 1.5 seconds). The toggling LED indicates that the record/playback loop is on-hold, i.e. is running but not listening. The on-hold mode is great for live presentations to avoid the board triggering on your speech until you're ready.
Hitting the USR
button will put the board into listen mode (indicated
by a solid GREEN LED). When listening you should be able to speak
(closely to the microphone) and, when you've stopped speaking (or when the
recording buffer is exhausted) the device should replay what it heard.
Hitting the USR
button will toggle the device between its on-hold and
listening modes.
Presentation slide (exported as a PDF document) can be found in the
presentation
directory.
Contains the following minor corrections to the original presentation slides.
- Typo in first bullet-point of slide
15
.4096
should be4095
- Correction of the block diagram in slide
23
. The green LED was shown as thePlayback
LED when it should have been the blue LED