<?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[Simple Click Sound]]></title><description><![CDATA[<p dir="auto">I'm using the LVGL with MicroPython for a project and I'd like to be able to make a click noice when the user interacts with the application's buttons.</p>
<p dir="auto">Is there any easy way to do that?</p>
]]></description><link>https://community.m5stack.com/topic/4409/simple-click-sound</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 06:20:48 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4409.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Jun 2022 23:13:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Simple Click Sound on Thu, 05 Jan 2023 04:11:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a></p>
<p dir="auto">Thanks. Any kind of sound would be great.</p>
<p dir="auto">My machine module doesn't have the I2S used in this example.</p>
<p dir="auto">/Chris</p>
]]></description><link>https://community.m5stack.com/post/19711</link><guid isPermaLink="true">https://community.m5stack.com/post/19711</guid><dc:creator><![CDATA[purpledread]]></dc:creator><pubDate>Thu, 05 Jan 2023 04:11:43 GMT</pubDate></item><item><title><![CDATA[Reply to Simple Click Sound on Sat, 23 Jul 2022 05:57:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/purpledread" aria-label="Profile: purpledread">@<bdi>purpledread</bdi></a></p>
<p dir="auto">not a click sound, but at least a <a href="https://github.com/felmue/MyM5StackExamples/blob/main/M5Core2/SimpleTone.py" target="_blank" rel="noopener noreferrer nofollow ugc">tone</a> on M5Core2.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/17979</link><guid isPermaLink="true">https://community.m5stack.com/post/17979</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sat, 23 Jul 2022 05:57:26 GMT</pubDate></item><item><title><![CDATA[Reply to Simple Click Sound on Mon, 04 Jul 2022 02:13:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/macsbug" aria-label="Profile: macsbug">@<bdi>macsbug</bdi></a></p>
<p dir="auto">I really appreciate the response,  but I'm running with an image that just has lvgl and micropython and not the M5 classes.</p>
<p dir="auto">Looking for how to play a sound with the standard esp32 hardware support on the device.</p>
<p dir="auto">/Chris</p>
]]></description><link>https://community.m5stack.com/post/17900</link><guid isPermaLink="true">https://community.m5stack.com/post/17900</guid><dc:creator><![CDATA[purpledread]]></dc:creator><pubDate>Mon, 04 Jul 2022 02:13:14 GMT</pubDate></item><item><title><![CDATA[Reply to Simple Click Sound on Sat, 02 Jul 2022 23:01:31 GMT]]></title><description><![CDATA[<p dir="auto">Hello＠purpledread</p>
<p dir="auto">I don't use MicroPython, but it works with the Arduino IDE.</p>
<p dir="auto">Development environment<br />
Arduino IDE 1.8.9<br />
LVGL 8.1.0<br />
M5Stack Basic , Gray , Fire</p>
<p dir="auto">Touch and button operation:<br />
Core2 is used with Touch (x, y).<br />
M5Stack is used by setting A, B, C Button with x, y.</p>
<p dir="auto">Output sound from Button:<br />
Use M5.Speaker.beep or M5.Speaker.tone.</p>
<p dir="auto">Set lv_conf.h for LVGL8 :<br />
//=====================================================================<br />
// Set lv_conf.h for LVGL8    : lvgl_8.1.0 / src / lv_conf.h<br />
// #define LV_TICK_CUSTOM 1   : LVGL lv_conf.h setup<br />
// #define LV_COLOR_DEPTH 16  : LVGL lv_conf.h setup<br />
// #define LV_COLOR_16_SWAP 0 : color<br />
//=====================================================================</p>
<p dir="auto">Arduino IDE example :<br />
//=====================================================================<br />
// <em>Initialize the (dummy) input device driver</em>/<br />
void init_m5_button(){<br />
static lv_indev_drv_t indev_drv;<br />
lv_indev_drv_init(&amp;indev_drv);<br />
indev_drv.type = LV_INDEV_TYPE_POINTER;<br />
indev_drv.read_cb = M5_btn;<br />
lv_indev_drv_register(&amp;indev_drv);<br />
}<br />
//=====================================================================<br />
// <a href="https://github.com/m5stack/m5-docs/blob/master/docs/ja/api/speaker.md" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/m5-docs/blob/master/docs/ja/api/speaker.md</a><br />
void M5_btn(lv_indev_drv_t<em>indev_driver,lv_indev_data_t</em>data){<br />
int mx, my;<br />
// A Button : Leftward ----------------------------------------------<br />
if (M5.BtnA.wasPressed()){ // center position<br />
mx = 320/2 -100; my = 240/2;<br />
data-&gt;point.x = mx; data-&gt;point.y = my;<br />
data-&gt;state = LV_INDEV_STATE_PR;<br />
//<br />
M5.Speaker.setVolume(2);  // 0, 1 to 8<br />
M5.Speaker.beep(); delay(100); // beep 100msec<br />
//<br />
M5.update(); return;<br />
}<br />
// B Button : Rightward ---------------------------------------------<br />
if (M5.BtnB.wasPressed()){<br />
mx = 320/2; my = 240/2;<br />
data-&gt;point.x = mx; data-&gt;point.y = my;<br />
data-&gt;state = LV_INDEV_STATE_PR;<br />
//<br />
M5.Speaker.setVolume(1);    // 0, 1 to 10<br />
M5.Speaker.tone(1000, 250); // 1KHz , 250msec<br />
//<br />
M5.update(); return;<br />
}<br />
// C Button : Auto / Manual Display ---------------------------------<br />
if (M5.BtnC.wasPressed()){<br />
mx = 320/2 + 100; my = 240/2;<br />
data-&gt;point.x = mx; data-&gt;point.y = my;<br />
data-&gt;state = LV_INDEV_STATE_PR;<br />
//<br />
M5.Speaker.setVolume(1); // 0, 1 to 10<br />
M5.Speaker.tone(440, 100); delay(100);<br />
M5.Speaker.mute();         delay(100);<br />
M5.Speaker.tone(440, 100); delay(100);<br />
M5.Speaker.mute();         delay(100);<br />
M5.Speaker.tone(440, 100);<br />
//<br />
M5.update(); return;<br />
}<br />
// No button operation ----------------------------------------------<br />
data-&gt;state = LV_INDEV_STATE_REL; M5.update(); return;<br />
}<br />
//=====================================================================</p>
<p dir="auto">Use btn Exsample from LVGL 8.1.0.<br />
// --------------------------------------------------------------------<br />
// lvgl(8.1.0) / examples / widgets / btn /<br />
//  lv_example_btn_1.c , lv_example_btn_2.c , lv_example_btn_3.c<br />
//  lv_example_btn_1.py<br />
lv_example_btn_1(); // From the btn demo of LVGL 8.1.0<br />
lv_example_btn_2(); // From the btn demo of LVGL 8.1.0<br />
lv_example_btn_3(); // From the btn demo of LVGL 8.1.0<br />
// --------------------------------------------------------------------</p>
<p dir="auto">：<br />
reference　:　Core 2 touch</p>
<p dir="auto">Void my_touchpad_read(lv_indev_drv_t * indev_driver,  lv_indev_data_t * data){<br />
TouchPoint_t pos = M5.Touch.getPressPoint();<br />
bool touched = ( pos.x == -1 ) ? false : true;<br />
if(!touched) {<br />
data-&gt;state = LV_INDEV_STATE_REL;<br />
} else {<br />
data-&gt;state = LV_INDEV_STATE_PR;<br />
/<em>Set the coordinates</em>/<br />
data-&gt;point.x = pos.x;<br />
data-&gt;point.y = pos.y;<br />
}<br />
return;<br />
}</p>
]]></description><link>https://community.m5stack.com/post/17877</link><guid isPermaLink="true">https://community.m5stack.com/post/17877</guid><dc:creator><![CDATA[macsbug]]></dc:creator><pubDate>Sat, 02 Jul 2022 23:01:31 GMT</pubDate></item><item><title><![CDATA[Reply to Simple Click Sound on Thu, 30 Jun 2022 23:14:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/purpledread" aria-label="Profile: purpledread">@<bdi>purpledread</bdi></a></p>
<p dir="auto">Should have mentioned I'm running on a M5Core2.</p>
<p dir="auto">/Chris</p>
]]></description><link>https://community.m5stack.com/post/17854</link><guid isPermaLink="true">https://community.m5stack.com/post/17854</guid><dc:creator><![CDATA[purpledread]]></dc:creator><pubDate>Thu, 30 Jun 2022 23:14:05 GMT</pubDate></item></channel></rss>