<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5StickC, UIFlow, Play Tone or Speaker.beep - how to add silence]]></title><description><![CDATA[<p dir="auto">I'm testing out the speaker hat on my newly acquired M5StickC.  I wrote a program which does other things but when I push Button B, I want it to play the first 6 notes of the Mario song.  I tried both the Play Tone and Speaker.beep functions but they both do the same thing.  Even though I'm specifying the first 3 notes, it is being played as if it were one note.  I put wait time between with no effect.  I need some separation between the notes.  I need staccato, not legato :)  Also, the end note continues to play, even after it exits this module.  Here's what I did (shown in Python):</p>
<p dir="auto">def buttonB_wasPressed():<br />
global q, i, bv, iv<br />
hat_spk1.tone(329, 200)<br />
wait_ms(200)<br />
hat_spk1.tone(329, 200)<br />
wait_ms(200)<br />
hat_spk1.tone(329, 200)<br />
wait_ms(200)<br />
hat_spk1.tone(523, 200)<br />
wait_ms(200)<br />
hat_spk1.tone(329, 200)<br />
wait_ms(200)<br />
hat_spk1.tone(784, 200)<br />
wait_ms(200)<br />
pass<br />
btnB.wasPressed(buttonB_wasPressed</p>
]]></description><link>https://community.m5stack.com/topic/1424/m5stickc-uiflow-play-tone-or-speaker-beep-how-to-add-silence</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 19:35:18 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1424.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Oct 2019 15:12:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5StickC, UIFlow, Play Tone or Speaker.beep - how to add silence on Sun, 27 Oct 2019 20:27:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/happy-hippo" aria-label="Profile: happy-hippo">@<bdi>happy-hippo</bdi></a> Music is not properly implemented in UIFlow and the walkaround for it is a bit complicated. but in essence I had to create variable for beats and DPM and then tie them all together.<br />
Unfortunately I seam to have misplaced the timing demo.</p>
]]></description><link>https://community.m5stack.com/post/6183</link><guid isPermaLink="true">https://community.m5stack.com/post/6183</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 27 Oct 2019 20:27:22 GMT</pubDate></item><item><title><![CDATA[Reply to M5StickC, UIFlow, Play Tone or Speaker.beep - how to add silence on Sun, 27 Oct 2019 19:36:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/happy-hippo" aria-label="Profile: happy-hippo">@<bdi>happy-hippo</bdi></a><br />
Here is the entire code I've been playing around with.  Basically, I'm flashing the LED for 100 times.  There is supposed to be a beep at the beginning of each flash.  That is not happening.  If I push Button A, the battery voltage and current displays.  That is working.  If I push Button B, the first 6 notes of Mario plays. That sort of works, except there is no separation between notes.  And the last note plays forever. I know this is super basic but I've just starting using this.</p>
<p dir="auto">I can run this in Arduino IDE with no problem; however, that doesn't help me learning UIFlow.</p>
<p dir="auto"><img src="/assets/uploads/files/1572204924311-da6e3a16-e2c9-4e6c-bd82-2d4effdc285d-image.png" alt="0_1572204923451_da6e3a16-e2c9-4e6c-bd82-2d4effdc285d-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/6178</link><guid isPermaLink="true">https://community.m5stack.com/post/6178</guid><dc:creator><![CDATA[Happy Hippo]]></dc:creator><pubDate>Sun, 27 Oct 2019 19:36:23 GMT</pubDate></item><item><title><![CDATA[Reply to M5StickC, UIFlow, Play Tone or Speaker.beep - how to add silence on Sun, 27 Oct 2019 19:13:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/happy-hippo" aria-label="Profile: happy-hippo">@<bdi>happy-hippo</bdi></a><br />
I made a better sounding one; however, it seems like the speaker.beep function is not paying any attention to the duration.  Like I said, the first 3 notes sound as one.</p>
<p dir="auto"><img src="/assets/uploads/files/1572203613116-d4a5edb6-6f8e-4589-925d-9c2c3ef2ccdb-image.png" alt="0_1572203612469_d4a5edb6-6f8e-4589-925d-9c2c3ef2ccdb-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/6177</link><guid isPermaLink="true">https://community.m5stack.com/post/6177</guid><dc:creator><![CDATA[Happy Hippo]]></dc:creator><pubDate>Sun, 27 Oct 2019 19:13:46 GMT</pubDate></item><item><title><![CDATA[Reply to M5StickC, UIFlow, Play Tone or Speaker.beep - how to add silence on Sun, 27 Oct 2019 16:59:30 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1572195558785-1f9b5dbf-f001-4647-93f0-57348dca08db-image.png" alt="0_1572195557039_1f9b5dbf-f001-4647-93f0-57348dca08db-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/6176</link><guid isPermaLink="true">https://community.m5stack.com/post/6176</guid><dc:creator><![CDATA[Happy Hippo]]></dc:creator><pubDate>Sun, 27 Oct 2019 16:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to M5StickC, UIFlow, Play Tone or Speaker.beep - how to add silence on Sun, 27 Oct 2019 15:24:09 GMT]]></title><description><![CDATA[<p dir="auto">Can you post a screen shot of your program.</p>
<p dir="auto">Are you using the Button loop?</p>
]]></description><link>https://community.m5stack.com/post/6175</link><guid isPermaLink="true">https://community.m5stack.com/post/6175</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 27 Oct 2019 15:24:09 GMT</pubDate></item></channel></rss>