Posts made by nicenemo
RE: Cannot GET DAC to play sine wave on speaker on Core2
Cannot GET DAC to play sine wave on speaker on Core2
Using UIFlow, I don't get the DAC to produce an audible sine wave on the internal speaker. What am I doing wrong? The speaker is not broken, it can play a wav file.
- I play a wav file from internal flash to confirm that the speaker is working.
- I initialize the Dac 0 to port 25. This should be connected to the speaker
- I start a sine wave on the DAC with a duration of 0, that should be infinite.
- A loop with some code to read and display the ToF sensor.
- The code to modify the frequency is omitted. I just want it to play 440 Hz for to sort out this problem. The loop code displays the sensor output changes, no problem there.
I want to make a Theremin using 2 ToF sensors, the DAC and the internal speaker. PbHub is not working either but there is a bug report elsewhere for that.
I also noticed I cannot set the speaker volume for the WAV? How to do that?
Is that the problem?
See screenshot below:
RE: Not possible to connect Pa.HUB on M5Stack CORE2
I have the same problem with the PaHub and two ToF sensors.
Simple code to reproduce below. And Screenshot for graphical representation.
from m5stack import * from m5stack_ui import * from uiflow import * import unit screen = M5Screen() screen.clean_screen() screen.set_screen_bg_color(0xFFFFFF) pahub0 = unit.get(unit.PAHUB, unit.PORTA) tof0 = unit.get(unit.TOF, unit.PAHUB0) tof1 = unit.get(unit.TOF, unit.PAHUB1) label0 = M5Label('Text', x=21, y=13, color=0x000, font=FONT_MONT_46, parent=None) label1 = M5Label('Text', x=21, y=71, color=0x000, font=FONT_MONT_46, parent=None) while True: label0.set_text(str(tof0.distance)) label1.set_text(str(tof1.distance)) wait_ms(2)