<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Coding Ideas and Suggestions, Irrigation System]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1501</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1501&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Coding Ideas and Suggestions, Irrigation System.]]></description>
		<lastBuildDate>Sat, 25 Jun 2022 20:23:58 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4700#p4700</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>To paste an image, right-click on the image and select &quot;copy image URL&quot;. Do not copy URL from browser line.</p></blockquote></div><p>Ok, thanks for the info.</p><p>And thanks for your help with the project as well!</p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Sat, 25 Jun 2022 20:23:58 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4700#p4700</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4699#p4699</link>
			<description><![CDATA[<p>This is good!<br />To paste an image, right-click on the image and select &quot;copy image URL&quot;. Do not copy URL from browser line.</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Sat, 25 Jun 2022 15:40:45 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4699#p4699</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4692#p4692</link>
			<description><![CDATA[<p>I think I may have corrected this issue now.<br />I have installed a grounded metal plate between the relay board and the controller.<br />I probably don&#039;t have the dielectric like it should be, all I have is a layer of plastic on each side of the plate where the controller and relay board are.<br />Another what I think was an issue is I had the wires for the clock module running in parallel next to the 24VAC lines. <br />I rerouted those wires as well.<br />So far, so good.</p><p><span class="postimg"><img src="https://i.ibb.co/B6KXrpJ/spsys-Plate.jpg" alt="https://i.ibb.co/B6KXrpJ/spsys-Plate.jpg" /></span></p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Mon, 20 Jun 2022 12:38:33 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4692#p4692</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4689#p4689</link>
			<description><![CDATA[<p>Yes I do. The controller and main esp module are behind the relay board. <br />I will have to see if I can fit something in there.<br />Basically to try and shield off the relay board and wires that have 24VAC right?</p><p>So a varistor or snubber on the solenoid load is not the proper approach, better to try your shielding method?</p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Thu, 16 Jun 2022 13:23:13 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4689#p4689</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4687#p4687</link>
			<description><![CDATA[<p>Do you have the controller under the relay module? Try to place a metal plate wrapped with a dielectric between the controller and the relay module.</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Thu, 16 Jun 2022 07:28:00 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4687#p4687</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4685#p4685</link>
			<description><![CDATA[<p>Thanks for the reply.<br />Sad part is, I&#039;ve had my box set up for a year or so and there&#039;s not too much free space.<br />The 2560 and the communications esp is behind the relay board.<br />Maybe if I put an iron plate behind the relay board, might be possible.</p><p><span class="postimg"><img src="https://i.ibb.co/RjC0z5C/spsys-Photo.jpg" alt="https://i.ibb.co/RjC0z5C/spsys-Photo.jpg" /></span></p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Wed, 15 Jun 2022 13:32:35 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4685#p4685</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4684#p4684</link>
			<description><![CDATA[<p>these interferences propagate as electromagnetic waves. Try to put the controller in an iron case and leave everything else outside</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Wed, 15 Jun 2022 07:36:42 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4684#p4684</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4683#p4683</link>
			<description><![CDATA[<p>I stand corrected, the solenoids are ran from 24VAC, not DC.</p><p>I&#039;m a little unsure of how to fix this interference issue. A snubber on the solenoid load perhaps?<br />FYI, my electrical design is almost as bad as my coding, lol.</p><p>Edit: Or maybe a varistor perhaps?</p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Tue, 14 Jun 2022 00:33:10 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4683#p4683</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4680#p4680</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Interference possible when switching high currents or inductive loads ??</p></blockquote></div><p>I&#039;m thinking this seem to be my issue. Thanks.<br />I&#039;ve tested multiple times running through single zones, manual (run all zones), and auto run with the 24v DC unplugged (not running zones), and have not had any restarts.</p><p>I am thinking from my &quot;googling&quot; that maybe adding in a diode at the zone solenoid might help with the issue?</p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Sun, 12 Jun 2022 17:10:12 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4680#p4680</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4679#p4679</link>
			<description><![CDATA[<p>Interference possible when switching high currents or inductive loads ??</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Sun, 12 Jun 2022 15:46:06 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4679#p4679</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4678#p4678</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>I mean. You have copied the values of the variables from RemoteXY struct into your new array. And now they are just different variables. If you change the values in the array, they will not change in the RemoteXY structure. And if the value of the variable in the RemoteXY structure changes, it will not change in the array. The variables are not bound.<br />Sorry for my English.</p></blockquote></div><p>Ok. Thank you. Think I understand what your saying.</p><p>After still having some issue yet and doing more testing, I&#039;m possibly thinking I may have an interference issue of some kind. </p><p>In the image below:</p><p>I have a separate 24v power supply coming into and looping through the relays for the load side.<br />In my testing I usually have this unplugged so the zones don&#039;t actually run (open up).<br />And with what appears to be &quot;bugless&quot; code, I don&#039;t experience an arduino restarts while testing.<br />But when I am running zones again (24v plugged in), I have intermittent unexplained restarts. </p><p>So with this thought in mind I have done more testing with 24v unplugged and am not having restart issues. </p><p>Is it possible to have some kind of interference from the 24v that has a completely separate power supply from the rest?<br />I am using this relay board: <a target="_blank" href="https://www.amazon.com/gp/product/B0057OC66U/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;th=1">https://www.amazon.com/gp/product/B0057 … 8&amp;th=1</a> </p><p><span class="postimg"><img src="https://gcdnb.pbrd.co/images/4vpRpIIgGnda.png" alt="https://gcdnb.pbrd.co/images/4vpRpIIgGnda.png" /></span></p><p>Edit: I don&#039;t know how to put an image on here.<br /><a target="_blank" href="https://pasteboard.co/4vpRpIIgGnda.png">https://pasteboard.co/4vpRpIIgGnda.png</a></p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Sun, 12 Jun 2022 02:24:55 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4678#p4678</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4675#p4675</link>
			<description><![CDATA[<div class="quotebox"><cite>jhome0005 wrote:</cite><blockquote><p>I didn&#039;t understand what you meant by </p><div class="quotebox"><blockquote><p>In the future, these values are not related in any way.</p></blockquote></div></blockquote></div><p>I mean. You have copied the values of the variables from RemoteXY struct into your new array. And now they are just different variables. If you change the values in the array, they will not change in the RemoteXY structure. And if the value of the variable in the RemoteXY structure changes, it will not change in the array. The variables are not bound.<br />Sorry for my English.</p>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Wed, 08 Jun 2022 05:31:16 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4675#p4675</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4674#p4674</link>
			<description><![CDATA[<p>Well I guess my single zones are not working now. Automatic and manual run through all zones is working fine.<br />Funny thing, single zones worked fine while testing on short time frames but now when I start using again it runs the zone from start to finish but the board resets after zone ends.<br />Back to the drawing board....</p>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Wed, 08 Jun 2022 03:43:33 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4674#p4674</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4673#p4673</link>
			<description><![CDATA[<p>Thanks for the reply. Yes your example worked out well.<br />I managed to somewhat shorten and refine my code which seems to be working properly..... so far.<br />I&#039;m sure there is more refining that can be done but will see how this works out for a bit.</p><p>I didn&#039;t understand what you meant by </p><div class="quotebox"><blockquote><p>In the future, these values are not related in any way.</p></blockquote></div><p>Here&#039;s a chunk of my reworked:<br /></p><div class="codebox"><pre><code>int relays[] = {PIN_PUMP_1, PIN_ZONE_1, PIN_ZONE_2, PIN_ZONE_3, PIN_ZONE_4, PIN_ZONE_5, PIN_ZONE_6, PIN_ZONE_7, PIN_ZONE_8, PIN_ZONE_9, PIN_ZONE_10, PIN_ZONE_11, PIN_ZONE_12};
uint8_t *pumpORzone[] = {&amp;RemoteXY.zone_1, &amp;RemoteXY.zone_2, &amp;RemoteXY.zone_3, &amp;RemoteXY.zone_4, &amp;RemoteXY.zone_5, &amp;RemoteXY.zone_6, &amp;RemoteXY.zone_7, &amp;RemoteXY.zone_8, &amp;RemoteXY.zone_9, &amp;RemoteXY.zone_10, &amp;RemoteXY.zone_11, &amp;RemoteXY.zone_12};
int *zoneRunTime[] = {&amp;RemoteXY.rTzone_1, &amp;RemoteXY.rTzone_2, &amp;RemoteXY.rTzone_3, &amp;RemoteXY.rTzone_4, &amp;RemoteXY.rTzone_5, &amp;RemoteXY.rTzone_6, &amp;RemoteXY.rTzone_7, &amp;RemoteXY.rTzone_8, &amp;RemoteXY.rTzone_9, &amp;RemoteXY.rTzone_10, &amp;RemoteXY.rTzone_11, &amp;RemoteXY.rTzone_12};
uint8_t *pumpORzoneLED[] = {&amp;RemoteXY.led_1_b, &amp;RemoteXY.led_2_b, &amp;RemoteXY.led_3_b, &amp;RemoteXY.led_4_b, &amp;RemoteXY.led_5_b, &amp;RemoteXY.led_6_b, &amp;RemoteXY.led_7_b, &amp;RemoteXY.led_8_b, &amp;RemoteXY.led_9_b, &amp;RemoteXY.led_10_b, &amp;RemoteXY.led_11_b, &amp;RemoteXY.led_12_b};
int currentZone = 0;   // current zone that is running
int singleZoneOn = -1; // single zones or zones started


loop:

// ADDED, A or M Switch Change////////////////////////////////////////////////////////////////////////////////////
  if ((RemoteXY.auto_Run == 1) &amp;&amp; (!autoON))
  {
    checkAorM();
  }
  if ((RemoteXY.manual_Run == 1) &amp;&amp; (!manualON))
  {
    checkAorM();
  }
  if ((autoON) &amp;&amp; (RemoteXY.auto_Run == 0))
  {
    checkAorM();
  }
  if ((manualON) &amp;&amp; (RemoteXY.manual_Run == 0))
  {
    checkAorM();
  }

  if (autoON)
  {
    if (AorM == 1)
    {
      if (RemoteXY.start_Time_Hour == t.hour)
      {
        if (RemoteXY.start_Time_Minute == t.min)
        {
          checkWeekday();
          if (((((((monDay) || (tueDay) || (wedDay) || (thuDay) || (friDay) || (satDay) || (sunDay)))))))
          {
            if (RemoteXY.season_Adj &gt;= 1)
            {
              valvesShutDown();
              AorM = 3;
              autoON = true;
              digitalWrite(PIN_AUTO_RUN, LOW);   // GREEN
              digitalWrite(AUTO_BLUE_PIN, HIGH); // BLUE
              DebugPrintln(&quot;Auto Time to Start&quot;);
            }
            else
            {
              AorM = 2;
              DebugPrintln(&quot;Skipping Autorun, Season Adjust Below 1&quot;);
            }
          }
        }
      }
    }
  }

  // Reset AorM after Autorun Season Adjust Too Low
  if ((AorM == 2) &amp;&amp; ((RemoteXY.start_Time_Minute + 1) == t.min))
  {
    AorM = 1;
    DebugPrintln(&quot;Autorun AorM Reset, Season Adjust Below 1&quot;);
  }

  if ((manualON) &amp;&amp; (AorM == 1))
  {
    AorM = 3;
    digitalWrite(PIN_MANUAL_RUN, HIGH); // RED
    DebugPrintln(&quot;Manual Time to Start, Red LED ON&quot;);
  }

  if ((AorM &gt;= 3) &amp;&amp; (AorM &lt; 8))
  {
    if (AorM == 3)
    {
      DebugPrintln(&quot;AorM = 3, Going to Start Pump&quot;);
      AorMisRunning();
    }

    if (AorM == 4)
    {
      if ((millis() - z1Mill) &gt;= pumpDelay)
      {
        AorM = 5;
        DebugPrintln(&quot;AorM = 5, Pump Delay is Over&quot;);
        AorMisRunning();
      }
    }
    if (AorM == 6)
    {
      if (millis() - z1Mill &gt;= xz1)
      {
        DebugPrintln(&quot;AorM = 6, Shutting Down and Switching Zones&quot;);
        AorMisSwitching();
      }
    }
    if (AorM == 7)
    {
      // if (currentZone == 1 || currentZone == 3 || currentZone == 5 || currentZone == 7)
      //{
      if ((millis() - z1Mill) &gt;= linkedPumpDelay)
      {
        AorM = 5;
        DebugPrintln(&quot;AorM = 7, Linked, Starting Second Zone&quot;);
        AorMisRunning();
      }
      //}
    }
  }
  // ADDED, A or M Switch Change////////////////////////////////////////////////////////////////////////////////////

  // ADDED, Single Zone Switchs ////////////////////////////////////////////////////////////////////////////////////
  if ((stateApp == 1) || (pumpRunning))
  {
    if ((AorM == 1) || (AorM == 16))
    {
      if (!manualON)
      {
        checkSingleZones();
      }
    }
  }

  if (singleZoneOn != -1)
  {
    if ((AorM == 8) || (AorM == 9))
    {
      if (zcrc == 0)
      {
        valvesShutDown();
        AorM = 8;
      }
      singleZoneStarting();
    }
    if (AorM == 14)
    {
      if ((millis() - z1Mill) &gt;= pumpDelay)
      {
        AorM = 15;
        DebugPrintln(&quot;Single Zone, Pump Delay is Over&quot;);
        singleZoneStarting();
      }
    }
    if (AorM == 16)
    {
      if (millis() - z1Mill &gt;= xz1)
      {
        DebugPrintln(&quot;Single Zones, Shutting Down Zones&quot;);
        currentZone = 0;
        singleZoneOn = -1;
        AorM = 1;
        valvesShutDown();
      }
    }
  }
  // ADDED, Single Zone Switchs ////////////////////////////////////////////////////////////////////////////////////
  
  // ADDED, Checking A or M Switches//////////////////////////////////////////////////////////////////////////////
void checkAorM()
{
  // If Auto was on and Auto Switch now off
  if ((autoON) &amp;&amp; (RemoteXY.auto_Run != 1))
  {
    valvesShutDown();
    AorM = 1;
    digitalWrite(PIN_AUTO_RUN, LOW); // GREEN
    RemoteXY.auto_Run = 0;
    DebugPrintln(&quot;Auto Was On and User Turned OFF, autoON Now is FALSE&quot;);
  }
  // If Manual was on and Manual Switch now off
  if ((manualON) &amp;&amp; (RemoteXY.manual_Run != 1))
  {
    valvesShutDown();
    AorM = 1;
    RemoteXY.manual_Run = 0;
    DebugPrintln(&quot;Manual Was On and User Turned OFF, autoON Now is FALSE&quot;);
  }
  // Turn off Auto Green LED while Manual is Running
  if ((autoON) &amp;&amp; (RemoteXY.manual_Run == 1))
  {
    AorM = 1;
    digitalWrite(PIN_AUTO_RUN, LOW); // GREEN
    valvesShutDown();
    manualON = true;
    DebugPrintln(&quot;Override Auto to Manual, manualON Now is TRUE&quot;);
  }
  // Turn on Auto Green LED after Manual is done
  if (((!manualON) &amp;&amp; (AorM == 1) &amp;&amp; (RemoteXY.auto_Run == 1)))
  {
    valvesShutDown();
    digitalWrite(PIN_AUTO_RUN, HIGH); // GREEN
    autoON = true;
    DebugPrintln(&quot;Manual Cycle Done Or Just Turning Auto ON, autoON Now is TRUE&quot;);
  }
  // Turn on Manual
  if ((!manualON) &amp;&amp; (RemoteXY.manual_Run == 1))
  {
    valvesShutDown();
    AorM = 1; // Should already be at 1???
    manualON = true;
    DebugPrintln(&quot;Manual Not ON, manualON Now is TRUE&quot;);
  }
}
// ADDED, Checking A or M Switches//////////////////////////////////////////////////////////////////////////////

// ADDED, Auto or Manual is Running/////////////////////////////////////////////////////////////////////////////
void AorMisRunning()
{
  if (sAdjust &lt;= 0)
  {
    sprintf(RemoteXY.SA_text, &quot;&lt;-THIS TASK ONLY&quot;);
    AorM = 1;
    RemoteXY.manual_Run = 0;
    valvesShutDown();
    DebugPrintln(&quot;AorM Season Adjust Less Than 1, Now Ending&quot;);
  }
  if (!pumpRunning)
  {
    pumpStart();
    currentZone = 0;
    AorM = 4;
  }
  if (AorM == 5)
  {
    int zonePlusOne = currentZone + 1; // Add 1 for Pump is at Zero Index
    digitalWrite(relays[zonePlusOne], LOW);
    xz1 = *zoneRunTime[currentZone] * 60000;
    // Check For Linked Zones
    if (RemoteXY.linked_Valves == 1)
    {
      if (currentZone &lt; 8)
      {
        // One Zone Already Started
        if (zcrc &gt;= 1)
        {
          AorM = 6;
        }
        // No Zones Started Yet
        else
        {
          AorM = 7;
        }
        //  if (currentZone == 1 || currentZone == 3 || currentZone == 5 || currentZone == 7)
        if (AorM == 6)
        {
          int tempZoneRT = currentZone;
          xz2 = *zoneRunTime[tempZoneRT] * 60000;
          xz1 = max(xz1, xz2);
          DebugPrintln(&quot;Linked Zone Run Time = &quot;);
          DebugPrint(xz1);
        }
      }
      // Stopping Linking Zones After 7 and 8 Get Linked (Don&#039;t Link 9-12)
      else
      {
        AorM = 6;
      }
    }
    if (RemoteXY.linked_Valves == 0)
    {
      AorM = 6;
    }
    xz1 = round(xz1 * sAdjust);
    zTime = xz1;
    if (xz1 &lt; 1)
    {
      pumpDelay = 0;
      linkedPumpDelay = 0;
    }
    else
    {
      pumpDelay = tempPumpDelay;
      linkedPumpDelay = tempLinkedPumpDelay;
    }
    DebugPrintln(sAdjust);
    DebugPrintln(zTime);
    *pumpORzone[currentZone] = 1;
    z1Mill = millis();
    zcrc++;
    *pumpORzoneLED[currentZone] = 255;
    DebugPrintln(&quot;Auto or Manual- Zone Started&quot;);
    currentZone++;
    // itoa(resetCounter, RemoteXY.rst_Times, 10); // MOVED HERE&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
    itoa(currentZone, RemoteXY.rst_Times, 10); // MOVED HERE&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  }
}
// ADDED, Auto or Manual is Running/////////////////////////////////////////////////////////////////////////////

// ADDED, Auto or Manual is Shutting Down Zones/////////////////////////////////////////////////////////////////
void AorMisSwitching()
{
  if (currentZone &lt; 12)
  {
    if (zcrc &gt; 1)
    {
      int zPlusOne = currentZone - 1; // Add 1 for Pump is at Zero Index
      int tempZone = currentZone - 2;
      digitalWrite(relays[zPlusOne], HIGH);
      *pumpORzone[tempZone] = 0;
      *pumpORzoneLED[tempZone] = 0;
      DebugPrintln(&quot;Auto or Manual Linked Zones Shutting Down&quot;);
    }
    int tempZone2 = currentZone - 1;
    digitalWrite(relays[currentZone], HIGH); // Add 1 for Pump is at Zero Index
    *pumpORzone[tempZone2] = 0;
    *pumpORzoneLED[tempZone2] = 0;
    AorM = 4;
    zcrc = 0;
    z1Mill = millis();
    DebugPrintln(&quot;Auto or Manual Zone Shutting Down&quot;);
  }
  else
  {
    if (RemoteXY.manual_Run != 0)
    {
      RemoteXY.manual_Run = 0;
    }
    AorM = 1;
    valvesShutDown();
  }
}
// ADDED, Auto or Manual is Shutting Down Zones/////////////////////////////////////////////////////////////////

// ADDED, Checking Single Zones for Control/////////////////////////////////////////////////////////////////////
void checkSingleZones()
{
  if (zcrc == 1)
  {
    int szo = *pumpORzone[singleZoneOn];
    if (szo == 0)
    {
      DebugPrintln(&quot;Single Zones, User Shut Down Zone&quot;);
      currentZone = 0;
      singleZoneOn = -1;
      AorM = 1;
      valvesShutDown();
    }
  }
  if (zcrc == 2)
  {
    int czo = *pumpORzone[currentZone];
    if (czo == 0)
    {
      DebugPrintln(&quot;Single Zones, User Shut Down Zone, Shutting Down Both&quot;);
      currentZone = 0;
      singleZoneOn = -1;
      AorM = 1;
      valvesShutDown();
    }
  }
  if (zcrc &lt; 2)
  {
    int z = 0;
    while (z &lt; 12)
    {
      uint8_t wz = *pumpORzone[z];
      if (wz == 1)
      {
        if (singleZoneOn == -1)
        {
          currentZone = z;
          singleZoneOn = z;
          AorM = 8;
          DebugPrintln(&quot;Single Zone, 1 Zone Set to Turn On&quot;);
          break;
        }
        if (singleZoneOn != -1)
        {
          if (z != singleZoneOn)
          {
            currentZone = z;
            AorM = 9;
            DebugPrintln(&quot;Single Zone, 2nd Zone Set to Turn On&quot;);
            break;
          }
        }
      }
      z++;
      // Below Prints Constantly
      // DebugPrintln(&quot;Single Zone, Zone Not On, Checking Next&quot;);
    }
  }
}

// ADDED, Checking Single Zones for Control/////////////////////////////////////////////////////////////////////

// ADDED, Single Zone Starting//////////////////////////////////////////////////////////////////////////////////
void singleZoneStarting()
{
  if (sAdjust &lt;= 0)
  {
    sprintf(RemoteXY.SA_text, &quot;&lt;-THIS TASK ONLY&quot;);
    AorM = 1;
    valvesShutDown();
    DebugPrintln(&quot;Single Zone Season Adjust Less Than 1, Now Ending&quot;);
  }
  if ((AorM == 8) || (AorM == 9))
  {
    if (!pumpRunning)
    {
      pumpStart();
      AorM = 14;
    }
    else
    {
      AorM = 14;
    }
  }
  if (AorM == 15)
  {
    int zonePlusOne = currentZone + 1; // Add 1 for Pump is at Zero Index
    digitalWrite(relays[zonePlusOne], LOW);
    xz1 = *zoneRunTime[currentZone] * 60000;
    xz1 = round(xz1 * sAdjust);
    zTime = xz1;
    if (xz1 &lt; 1)
    {
      pumpDelay = 0;
      linkedPumpDelay = 0;
    }
    else
    {
      pumpDelay = tempPumpDelay;
      linkedPumpDelay = tempLinkedPumpDelay;
    }
    DebugPrintln(sAdjust);
    DebugPrintln(zTime);
    *pumpORzone[currentZone] = 1;
    z1Mill = millis();
    zcrc++;
    AorM = 16;
    *pumpORzoneLED[currentZone] = 255;
    DebugPrintln(&quot;Single Zone- Zone Started&quot;);
    //  itoa(resetCounter, RemoteXY.rst_Times, 10); // MOVED HERE&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
    itoa(currentZone, RemoteXY.rst_Times, 10); // MOVED HERE&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  }
}
// ADDED, Single Zone Starting////////////////////////////////////////////////////////////////////////////////</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (jhome0005)]]></author>
			<pubDate>Tue, 07 Jun 2022 02:05:52 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4673#p4673</guid>
		</item>
		<item>
			<title><![CDATA[Re: Coding Ideas and Suggestions, Irrigation System]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4672#p4672</link>
			<description><![CDATA[<p>It won&#039;t work. You declare an array and write the current values of the variables from the RemoteXY structure. In the future, these values are not related in any way.<br />Try the following. Declare an array of references to variables of RemoteXY structure, then refer to the variables by reference through the array.<br /></p><div class="codebox"><pre><code>uint8_t * zones[] = {&amp;RemoteXY.zone_1, &amp;RemoteXY.zone_2, &amp;RemoteXY.zone_3, &amp;RemoteXY.zone_4, &amp;RemoteXY.zone_5, &amp;RemoteXY.zone_6, &amp;RemoteXY.zone_7, &amp;RemoteXY.zone_8, &amp;RemoteXY.zone_9, &amp;RemoteXY.zone_10, &amp;RemoteXY.zone_11, &amp;RemoteXY.zone_12};

*zones[2] = 1;  // write
uint8_t v = *zones[2] ;  // read</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (remotexy)]]></author>
			<pubDate>Fri, 03 Jun 2022 05:53:26 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4672#p4672</guid>
		</item>
	</channel>
</rss>
