<?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[Determining status of individual sensors.]]></title><description><![CDATA[<p dir="auto">I'd like to be able to determine the status of individual sensors on the PySense. This is part of a longer strategy to incorporate additional sensors but determine which ones are active on each board as part of an initialisation.<br />
I've tried using the _read_status(self) function of the barometer but I can't get it to work, e.g.</p>
<p dir="auto">barometer_ready = MPL3115A2._read_status()</p>
<p dir="auto">I don't know what to pass as the parameter because self is part of the class and has no meaning outside of it.</p>
]]></description><link>https://forum.pycom.io/topic/2240/determining-status-of-individual-sensors</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 06:17:22 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/2240.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Nov 2017 11:08:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Determining status of individual sensors. on Thu, 30 Nov 2017 11:08:15 GMT]]></title><description><![CDATA[<p dir="auto">I'd like to be able to determine the status of individual sensors on the PySense. This is part of a longer strategy to incorporate additional sensors but determine which ones are active on each board as part of an initialisation.<br />
I've tried using the _read_status(self) function of the barometer but I can't get it to work, e.g.</p>
<p dir="auto">barometer_ready = MPL3115A2._read_status()</p>
<p dir="auto">I don't know what to pass as the parameter because self is part of the class and has no meaning outside of it.</p>
]]></description><link>https://forum.pycom.io/post/13268</link><guid isPermaLink="true">https://forum.pycom.io/post/13268</guid><dc:creator><![CDATA[alidaf]]></dc:creator><pubDate>Thu, 30 Nov 2017 11:08:15 GMT</pubDate></item><item><title><![CDATA[Reply to Determining status of individual sensors. on Thu, 30 Nov 2017 13:07:50 GMT]]></title><description><![CDATA[<p dir="auto">rather that calling the method of the class directly you should first create an instance of the class and call the method of the instance:</p>
<pre><code>from pysense import Pysense
from MPL3115A2 import MPL3115A2

py = Pysense()
baro = MPL3115A2(py)
barometer_ready = baro._read_status()
</code></pre>
<p dir="auto">You may also need to pass mode when instantiating the barometer depending on if you want to measure pressure or altitude. Please refer to our documentation for more details: <a href="https://docs.pycom.io/chapter/pytrackpysense/apireference/pysense.html" target="_blank" rel="noopener noreferrer nofollow">https://docs.pycom.io/chapter/pytrackpysense/apireference/pysense.html</a></p>
]]></description><link>https://forum.pycom.io/post/13273</link><guid isPermaLink="true">https://forum.pycom.io/post/13273</guid><dc:creator><![CDATA[seb]]></dc:creator><pubDate>Thu, 30 Nov 2017 13:07:50 GMT</pubDate></item><item><title><![CDATA[Reply to Determining status of individual sensors. on Thu, 30 Nov 2017 13:40:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1881">@seb</a> That works fine. I already had an instance in order for the readings to work but for some reason....idiot mode active. I need some sleep!</p>
<p dir="auto">Many thanks.</p>
<p dir="auto">There doesn't appear to be anything equivalent in the LTR329ALS01 or SI7006A20 ibraries though.</p>
]]></description><link>https://forum.pycom.io/post/13276</link><guid isPermaLink="true">https://forum.pycom.io/post/13276</guid><dc:creator><![CDATA[alidaf]]></dc:creator><pubDate>Thu, 30 Nov 2017 13:40:38 GMT</pubDate></item><item><title><![CDATA[Reply to Determining status of individual sensors. on Fri, 01 Dec 2017 12:11:42 GMT]]></title><description><![CDATA[<p dir="auto">Can you explain in more detail what you are attempting to achieve? Are you just looking for which sensors are present?</p>
]]></description><link>https://forum.pycom.io/post/13307</link><guid isPermaLink="true">https://forum.pycom.io/post/13307</guid><dc:creator><![CDATA[seb]]></dc:creator><pubDate>Fri, 01 Dec 2017 12:11:42 GMT</pubDate></item><item><title><![CDATA[Reply to Determining status of individual sensors. on Fri, 01 Dec 2017 12:22:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1881">@seb</a> Yes, I would like to have multiple boards with a selection of sensors on each but I don't want to change the code according to which specific sensors I have attached. I want the initialisation procedure to determine which of those sensors are present and the main code therefore only read from those that are attached. Kind of like a plug and play but without hot-plugging.</p>
<p dir="auto">It should be straightforward but I wanted to at least demonstrate the process without having to modify libraries. At least for the time being. I think as the PyCom eco-system develops and libraries are added, it should be a pre-requisite to have a function like this for any external hardware.</p>
<p dir="auto">Regards</p>
]]></description><link>https://forum.pycom.io/post/13309</link><guid isPermaLink="true">https://forum.pycom.io/post/13309</guid><dc:creator><![CDATA[alidaf]]></dc:creator><pubDate>Fri, 01 Dec 2017 12:22:48 GMT</pubDate></item><item><title><![CDATA[Reply to Determining status of individual sensors. on Fri, 01 Dec 2017 12:55:33 GMT]]></title><description><![CDATA[<p dir="auto">You could use the scan method of the I2C class to detect what sensors are present on the bus. Then based on what addresses you can find you can run/not run the code relating to that sensor.</p>
]]></description><link>https://forum.pycom.io/post/13311</link><guid isPermaLink="true">https://forum.pycom.io/post/13311</guid><dc:creator><![CDATA[seb]]></dc:creator><pubDate>Fri, 01 Dec 2017 12:55:33 GMT</pubDate></item><item><title><![CDATA[Reply to Determining status of individual sensors. on Fri, 01 Dec 2017 14:11:31 GMT]]></title><description><![CDATA[<p dir="auto">The simplest solutions are the best. I'll give that a go. Many thanks <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1881">@seb</a>.</p>
]]></description><link>https://forum.pycom.io/post/13314</link><guid isPermaLink="true">https://forum.pycom.io/post/13314</guid><dc:creator><![CDATA[alidaf]]></dc:creator><pubDate>Fri, 01 Dec 2017 14:11:31 GMT</pubDate></item></channel></rss>