<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to count and control the switch press. in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-count-and-control-the-switch-press/m-p/1645188#M65022</link>
    <description>&lt;P&gt;if (adcResultInMv &amp;gt;4125)&lt;BR /&gt;{&lt;BR /&gt;GPIOA_PSOR |= 1&amp;lt;&amp;lt;PTA3 | 1&amp;lt;&amp;lt;PTA2;&lt;BR /&gt;GPIOA_PCOR |= 1&amp;lt;&amp;lt;PTB5;&lt;BR /&gt;if (GPIOA_PDIR &amp;amp; (1&amp;lt;&amp;lt;PTA1)) {&lt;BR /&gt;GPIOA_PSOR |= 1&amp;lt;&amp;lt;PTB5;&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;GPIOA_PCOR |= 1&amp;lt;&amp;lt;PTB5;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above code, i want to count the switch press event and based on the number of switch pressed (if switch pressed &amp;gt;5 ) permanently turn off the Red LED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone one help me to figure out this issue.&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2023 03:26:05 GMT</pubDate>
    <dc:creator>SBK_SBK_SBK_SBK</dc:creator>
    <dc:date>2023-05-05T03:26:05Z</dc:date>
    <item>
      <title>How to count and control the switch press.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-count-and-control-the-switch-press/m-p/1645188#M65022</link>
      <description>&lt;P&gt;if (adcResultInMv &amp;gt;4125)&lt;BR /&gt;{&lt;BR /&gt;GPIOA_PSOR |= 1&amp;lt;&amp;lt;PTA3 | 1&amp;lt;&amp;lt;PTA2;&lt;BR /&gt;GPIOA_PCOR |= 1&amp;lt;&amp;lt;PTB5;&lt;BR /&gt;if (GPIOA_PDIR &amp;amp; (1&amp;lt;&amp;lt;PTA1)) {&lt;BR /&gt;GPIOA_PSOR |= 1&amp;lt;&amp;lt;PTB5;&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;GPIOA_PCOR |= 1&amp;lt;&amp;lt;PTB5;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above code, i want to count the switch press event and based on the number of switch pressed (if switch pressed &amp;gt;5 ) permanently turn off the Red LED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone one help me to figure out this issue.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 03:26:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-count-and-control-the-switch-press/m-p/1645188#M65022</guid>
      <dc:creator>SBK_SBK_SBK_SBK</dc:creator>
      <dc:date>2023-05-05T03:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to count and control the switch press.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-count-and-control-the-switch-press/m-p/1645551#M65024</link>
      <description>It is probably not (|=) OR that you want, rather just assignment (=).. The NXP examples are full of these bad examples. They end up clearing bits that you did not mean to clear.&lt;BR /&gt;&lt;BR /&gt;Not clear how the ADC is involved here? If more than five switches are pressed turn off the LED?&lt;BR /&gt;&lt;BR /&gt;Switches are not ideal devices. Unless debouced one press can look like many presses. That is detailed here along with code to debounce them:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.ganssle.com/debouncing.htm" target="_blank"&gt;http://www.ganssle.com/debouncing.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 May 2023 12:51:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-count-and-control-the-switch-press/m-p/1645551#M65024</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2023-05-05T12:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to count and control the switch press.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-count-and-control-the-switch-press/m-p/1646053#M65027</link>
      <description>Thanks for your reply.&lt;BR /&gt;Surely, i will go through it.&lt;BR /&gt;</description>
      <pubDate>Mon, 08 May 2023 03:07:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-count-and-control-the-switch-press/m-p/1646053#M65027</guid>
      <dc:creator>SBK_SBK_SBK_SBK</dc:creator>
      <dc:date>2023-05-08T03:07:42Z</dc:date>
    </item>
  </channel>
</rss>

