<?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[How do I invert a reading in UIFLow2?]]></title><description><![CDATA[<p dir="auto">Ok so my brain has totally failed today which leaves me with the following question.<br />
This is the code I have so far:</p>
<p dir="auto"><img src="/assets/uploads/files/1708766761751-screenshot-2024-02-24-at-09.24.12-resized.png" alt="0_1708766759351_Screenshot 2024-02-24 at 09.24.12.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">When the soil level Moisture increases the reading goes down. For correct readings I need the level to work in the complete reverse and go up as the moisture increases.</p>
<p dir="auto">What do I need to change to invert the reading as numbers is hard for me to calculate today?</p>
]]></description><link>https://community.m5stack.com/topic/6146/how-do-i-invert-a-reading-in-uiflow2</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 04:16:25 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6146.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Feb 2024 09:27:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How do I invert a reading in UIFLow2? on Sun, 25 Feb 2024 07:45:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/teastain" aria-label="Profile: teastain">@<bdi>teastain</bdi></a> Ah Ok thanks, I avoid arduino like the plague so didn't notice.</p>
<p dir="auto">Hopefully that means that people can read the example and simply port to arduino.</p>
]]></description><link>https://community.m5stack.com/post/24119</link><guid isPermaLink="true">https://community.m5stack.com/post/24119</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 25 Feb 2024 07:45:29 GMT</pubDate></item><item><title><![CDATA[Reply to How do I invert a reading in UIFLow2? on Sat, 24 Feb 2024 20:54:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a><br />
This is Arduino C:<br />
It reads VERBALLY  just like your UIFlow program!</p>
<pre><code>If ((ADC8 / 4096) * 100 &lt; 20) {
DigitalWrite(9 = HIGH)
}
else{
DigitalWrite(9 = LOW)
}
</code></pre>
<p dir="auto">But brackets and things.<br />
-Cheers</p>
]]></description><link>https://community.m5stack.com/post/24110</link><guid isPermaLink="true">https://community.m5stack.com/post/24110</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Sat, 24 Feb 2024 20:54:02 GMT</pubDate></item><item><title><![CDATA[Reply to How do I invert a reading in UIFLow2? on Sat, 24 Feb 2024 20:41:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/teastain" aria-label="Profile: teastain">@<bdi>teastain</bdi></a> Thanks you suggestion works I just did &gt;50% to operate the pump and uploaded the code to the project zone.</p>
<p dir="auto">What do you mean reads like C, is that a good thing or a bad thing because I was following a Maths exam guide for the formula as I had forgotten it.</p>
]]></description><link>https://community.m5stack.com/post/24107</link><guid isPermaLink="true">https://community.m5stack.com/post/24107</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sat, 24 Feb 2024 20:41:01 GMT</pubDate></item><item><title><![CDATA[Reply to How do I invert a reading in UIFLow2? on Sat, 24 Feb 2024 20:28:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> I understood and I suggested turning on the water when the soil was dry, which is what you wanted.<br />
So change the &lt;20 to &gt; 'some value' that is too dry.<br />
I have a ENV Pro that I thought the gas reading was in a direction that was not logical (helpful to the Brain) so I reversed it to display an increase, instead of a decrease.</p>
<pre><code>  VOC = (1 / gas_resistance) * 10000;
</code></pre>
<p dir="auto">So I guess you could do a reciprocal of the ADC reading and scale it to suit, but that seems like more work to me!<br />
I only jumped in because your UIFlow program reads like C!!!</p>
]]></description><link>https://community.m5stack.com/post/24104</link><guid isPermaLink="true">https://community.m5stack.com/post/24104</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Sat, 24 Feb 2024 20:28:32 GMT</pubDate></item><item><title><![CDATA[Reply to How do I invert a reading in UIFLow2? on Sat, 24 Feb 2024 18:16:03 GMT]]></title><description><![CDATA[<p dir="auto">Sorry why I mean is that when the Moisture level in the soil increases, the ADC value goes down and after the percentage calculation the percentage value goes down.</p>
<p dir="auto">What I want is the percentage reading to go in the reverse but I cant seam to work out how.</p>
]]></description><link>https://community.m5stack.com/post/24097</link><guid isPermaLink="true">https://community.m5stack.com/post/24097</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sat, 24 Feb 2024 18:16:03 GMT</pubDate></item><item><title><![CDATA[Reply to How do I invert a reading in UIFLow2? on Sat, 24 Feb 2024 17:39:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> if greater than &gt; the desired value?</p>
]]></description><link>https://community.m5stack.com/post/24096</link><guid isPermaLink="true">https://community.m5stack.com/post/24096</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Sat, 24 Feb 2024 17:39:49 GMT</pubDate></item></channel></rss>