<?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[DLIGHT - read from microPython]]></title><description><![CDATA[<p dir="auto">I have an ATOM S3 Lite with a DLIGHT connected to the Grove interface.  DLIGHT is the "Ambient Light Unit" with a light sensor of some kind.  I have the UIFlow v2 on the ATOM, so microPython is working.  I want to read the values from the DLIGHT sensor.<br />
I have code like the following:</p>
<pre><code> import machine
 i2c = machine.SoftI2C(scl=machine.Pin(32), sda=machine.Pin(26))
 i2c.scan()
 i2c.readfrom(35, 2)
</code></pre>
<p dir="auto">the scan() function returns [35] so I presume it is connecting successfully.<br />
But the readfrom() always returns b'\x00\x00' no matter what brightness the light is on the sensor.<br />
Is there something else I need to do, to initialize the DLIGHT?<br />
Or do I need to pass 'freq' or other parameters when I create the i2c object?</p>
]]></description><link>https://community.m5stack.com/topic/5344/dlight-read-from-micropython</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 07:59:06 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5344.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 May 2023 19:53:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLIGHT - read from microPython on Mon, 29 May 2023 17:52:13 GMT]]></title><description><![CDATA[<p dir="auto">Actually I mis-identified my module, it's ATOM LITE not ATOM S3 LITE on closer inspection (the names of these things can be confusing).  I got the pin numbers scl 32 and sda 26 from the legend on the device itself, and I think they must be correct since it is able to reply with the [35] from the scan() function.</p>
<p dir="auto">I tried looking at the Arduino code from GitHub to see if it does some kind of initialization of the DLIGHT before reading, but I can't figure it out.</p>
<p dir="auto">Anyway thanks for replying Terry.</p>
]]></description><link>https://community.m5stack.com/post/21029</link><guid isPermaLink="true">https://community.m5stack.com/post/21029</guid><dc:creator><![CDATA[forestial]]></dc:creator><pubDate>Mon, 29 May 2023 17:52:13 GMT</pubDate></item><item><title><![CDATA[Reply to DLIGHT - read from microPython on Mon, 29 May 2023 04:32:41 GMT]]></title><description><![CDATA[<p dir="auto">If this:<br />
<a href="https://docs.m5stack.com/en/core/AtomS3%20Lite" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/en/core/AtomS3 Lite</a><br />
is your unit, maybe try pins scl 1 and sda 2 ?<br />
Works (on Arduino IDE, anyway), for me!<br />
-Terry</p>
]]></description><link>https://community.m5stack.com/post/21025</link><guid isPermaLink="true">https://community.m5stack.com/post/21025</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Mon, 29 May 2023 04:32:41 GMT</pubDate></item></channel></rss>