<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Persistant Button Logic - Projects				            </title>
            <link>https://www.simhubdash.com/community-2/projects/persistant-button-logic/</link>
            <description>All about SimHub!</description>
            <language>en-US</language>
            <lastBuildDate>Tue, 08 Sep 2026 00:02:01 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Persistant Button Logic</title>
                        <link>https://www.simhubdash.com/community-2/projects/persistant-button-logic/#post-7875</link>
                        <pubDate>Sun, 05 Nov 2023 18:10:08 +0000</pubDate>
                        <description><![CDATA[Greetings,
I wanted some button logic for two different output states:
(1) change and hold the state to ON/OFF on EACH button press
(2) changes on JUST ONE CYCLE to &#039;ON&#039; on a button press...]]></description>
                        <content:encoded><![CDATA[<p>Greetings,</p>
<p>I wanted some button logic for two different output states:</p>
<p>(1) change and hold the state to ON/OFF on EACH button press</p>
<p>(2) changes on JUST ONE CYCLE to 'ON' on a button press</p>
<p>the code...</p>
<p> </p>
<p>function myOnOffButton(swButtonAction)<br />{<br />// ON/OFF Button Logic- Terry Abbott - 2023.03.18<br /><br />// single button flipflop logic<br />// changes and holds the state to ON/OFF on EACH button press <br />// (button should be set up as press/release)<br /><br />if (root==null) <br />{ <br />root=0;<br />}<br />if (root==null) <br />{ <br />root=0; <br />}<br /><br />if (swButtonAction != root) <br />{<br />if (root == 0) <br />{<br />root = !root;<br />}<br />root = swButtonAction;<br />}<br />return root;<br />}<br /><br /><br />function myOneShotButton(swButtonAction)<br />{<br />// ONE-SHOT Button Logic- Terry Abbott - 2023.03.18<br /><br />// single button flipflop logic<br />// changes on JUST ONE CYCLE to 'ON' on a button press <br />// (button should be set up as press/release)<br /><br />var oneShot;<br /><br />if (root==null) <br />{ <br />root=0; <br />}<br />if (root==null) <br />{ <br />root=0; <br />}<br /><br />oneShot = false;<br /><br />if (swButtonAction != root) <br />{<br />if (root == 0) <br />{<br />// should really be set to true, with each call ic'd to false<br />oneShot = true;<br />}<br />root = swButtonAction;<br />}<br /><br />return oneShot;<br />}</p>]]></content:encoded>
						                            <category domain="https://www.simhubdash.com/community-2/projects/">Projects</category>                        <dc:creator>TerryA</dc:creator>
                        <guid isPermaLink="true">https://www.simhubdash.com/community-2/projects/persistant-button-logic/#post-7875</guid>
                    </item>
							        </channel>
        </rss>
		