<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Dont forget to debounce your buttons!</title>
		<link>http://forums.leaflabs.com/topic.php?id=649</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:12 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=649" rel="self" type="application/rss+xml" />

		<item>
			<title>poslathian on "Dont forget to debounce your buttons!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=649#post-3607</link>
			<pubDate>Fri, 11 Feb 2011 11:56:50 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">3607@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;When you hit a button, usually it switches back and forth a bunch of times as the two metal plates vibrate against one another. At 72MHz, youll need to watch out for this, for example:&#60;/p&#62;
&#60;p&#62;int count = 0;&#60;br /&#62;
void loop() {&#60;br /&#62;
   while(!digitalRead(BOARD_BUT_PIN)); // wait for press&#60;br /&#62;
   // delay(1)  // uncomment this line for simple solution&#60;br /&#62;
   while(digitalRead(BOARD_BUT_PIN));  // wait for button up&#60;br /&#62;
   count++;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;this could easily result in a count of more than 1 despite only pressing and releasing the button once. A simple solution is to add a delay.  But you can be more clever than that!&#60;/p&#62;
&#60;p&#62;here is an article on the subject&#60;br /&#62;
&#60;a href=&#34;http://www.eetimes.com/discussion/break-point/4024944/The-secret-life-of-switches&#34; rel=&#34;nofollow&#34;&#62;http://www.eetimes.com/discussion/break-point/4024944/The-secret-life-of-switches&#60;/a&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
