I am always trying to find out, how far Micropython can be pushed.
It is a practical programming language for rapid prototyping.
During this project I was and am playing around with
*) I2S (this is not so complicated, but I was using it for the first time)
*) creating pure audio tone (sinus) that can change frequency without noticeable distortion
*) multi-threading
All comments regarding the code can be found on the GitHub repo.
UPDATE:
The current code has the problem that if the length of the signal arrays differs too much, one of the signals starts cracking. This is because the shorter array in the I2S buffer is emptied earlier. Unfortunately I haven't managed to get the interrupt routine to work until now. This could solve the problem. I'm not sure if the irq from the I2S in Micropython was properly implemented on the ESP32. I will let the project rest for now and try again with a newer version of Micropython.
Components
1×
ESP32-WROOM32
3×
VL53L0X
Time-of-Flight sensor
2×
PCM5102
Data Converters / Digital to Analog Converters (DACs)