PWM out to speaker in simulator?

I’d like to use the Pins extension to send a PWM signal to the audio output device of the simulator – the same output destination where musical notes are played. Is this possible in the simulator? Is it bound to a pin?

1 Like

There is a number block, under the division block, that you can drag onto both parameters in the play tone block. The first parameter is the hertz and the second parameter is the duration in milliseconds.

Thank you for your reply! I think I asked the wrong question. What I want to do is manually set the output value of the pin that drives the speaker. This is straight forward on hardware, but I can’t seem to find a pin that will produce a sound in the simulator.

I want to experiment with combining wave oscillator values and sending the output to the speaker to make a rudimentary sound synthesizer. Thinking something like this cute app, but for meowbit: https://apps.apple.com/us/app/bebot-robot-synth/id300309944

1 Like

BTW, you can play up to 5 notes at the same time, use the timers extension (which is now in the list of extensions in the editor) to play the notes in the background. You also have a limit of 2000 ms per note played.

1 Like