<?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[Flashlight Module: How to use it with PWM]]></title><description><![CDATA[<p dir="auto">Dear forum members,</p>
<p dir="auto">I hope this message finds you all well. Currently, I am working in a project that involves utilizing the M5Stack Timer Camera F within the ESP-IDF (Espressif IoT Development Framework) environment. As I progress with my project, I have encountered a problem regarding the functionality and proper usage of the FlashLight module, which operates through a 1-wire interface.</p>
<p dir="auto">I have looked at the example, but I was unable to reproduce the behavior in the ESP-IDF environment.</p>
<p dir="auto">Based on the documentation provided for the UNIT FlashLight module , it is mentioned that the module can be controlled using PWM (Pulse Width Modulation) techniques. I was able to use the flashlight using pwm on the "S" pin of the module. However, I have noticed that in practice, achieving smooth regulation of the light intensity is proving challenging. When attempting to use smaller values for duty cycles, the light fails to power on. Additionally, it appears that the module primarily functions reliably for higher duty cycles.</p>
<p dir="auto">I would greatly appreciate any insights, experiences, or suggestions you may have in addressing this matter. If anyone has successfully used the UNIT FlashLight module with the ESP-IDF environment and has overcome similar challenges, your input would be immensely helpful.</p>
<p dir="auto">Thank you in advance for your valuable time and support.</p>
<p dir="auto">Best regards,</p>
<p dir="auto">Simone</p>
]]></description><link>https://community.m5stack.com/topic/5335/flashlight-module-how-to-use-it-with-pwm</link><generator>RSS for Node</generator><lastBuildDate>Sat, 09 May 2026 00:21:00 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5335.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 May 2023 15:30:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Flashlight Module: How to use it with PWM on Mon, 24 Nov 2025 21:59:51 GMT]]></title><description><![CDATA[<p dir="auto">Dear Simone,</p>
<p dir="auto">I also stumbled upon this issue. I finally figured out that the m5stack Unit Flashlight module has two operation modes.</p>
<p dir="auto">It defaults to FLASH which is controlled by some custom logic which can be found here:<br />
<a href="https://github.com/m5stack/M5Unit-FlashLight/blob/main/SetFlashTimeAndBrightness/SetFlashTimeAndBrightness.ino" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5Unit-FlashLight/blob/main/SetFlashTimeAndBrightness/SetFlashTimeAndBrightness.ino</a></p>
<p dir="auto">But you can open the device and switch it to TORCH mode using a physical switch inside. Then you can use PWM to control it.</p>
<p dir="auto">The details regarding the operation modes and PWM can be found in the specs starting at page 12:<br />
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/FlashLight/FLASHLEDDRIVER_2019-07-01.PDF" target="_blank" rel="noopener noreferrer nofollow ugc">https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/FlashLight/FLASHLEDDRIVER_2019-07-01.PDF</a></p>
<p dir="auto">This will hopefully help others stumbling upon this.</p>
<p dir="auto">Best regards</p>
]]></description><link>https://community.m5stack.com/post/30233</link><guid isPermaLink="true">https://community.m5stack.com/post/30233</guid><dc:creator><![CDATA[mback2k]]></dc:creator><pubDate>Mon, 24 Nov 2025 21:59:51 GMT</pubDate></item></channel></rss>