<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: PIR sensing with Max</title>
		<atom:link href="http://cycling74.com/forums/topic/pir-sensing-with-max/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/pir-sensing-with-max/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 20:33:28 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/pir-sensing-with-max/#post-64947</guid>
					<title><![CDATA[PIR sensing with Max]]></title>
					<link>http://cycling74.com/forums/topic/pir-sensing-with-max/#post-64947</link>
					<pubDate>Fri, 26 Oct 2012 20:34:29 +0000</pubDate>
					<dc:creator>albab</dc:creator>

					<description>
						<![CDATA[
						<p>Hey,</p>
<p>I&#8217;m currently trying to read a digital pin (2) on the Arduino when it&#8217;s HIGH/LOW from a Parallax PIR sensor. The setup is basically this without the piezo: <a href="http://makeprojects.com/Project/PIR+Sensor+Arduino+Alarm/72/1#.UIrppGl26A1" rel="nofollow">http://makeprojects.com/Project/PIR+Sensor+Arduino+Alarm/72/1#.UIrppGl26A1</a></p>
<p>I&#8217;ve tried using Maxuino, Arduino2Max and even the SensorBox but to no avail. Does anyone know if the PIR sensor can be read with just the setup above? Or am I going to need to do something else hardware wise? Also, do I have to include code like PIRsense (<a href="http://www.arduino.cc/playground/Code/PIRsense" rel="nofollow">http://www.arduino.cc/playground/Code/PIRsense</a>) with the Firmata or SensorBox code in order to read the PIR? </p>
<p>Hope that makes sense. I&#8217;ve tried inquiring over at the Arduino forums too but feel like there has to be someone on the forums here who has done this.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/pir-sensing-with-max/#post-234204</guid>
					<title><![CDATA[Re: PIR sensing with Max]]></title>
					<link>http://cycling74.com/forums/topic/pir-sensing-with-max/#post-234204</link>
					<pubDate>Sat, 27 Oct 2012 11:35:23 +0000</pubDate>
					<dc:creator>n00b_meister</dc:creator>

					<description>
						<![CDATA[
						<p>Hi<br />
the first thing to check is your circuit, with some simple code. If your PIR is connected like this:</p>
<p><a href="http://guide-images.makeprojects.org/igi/wCMlmK5wTNxgOPiw.huge" rel="nofollow">http://guide-images.makeprojects.org/igi/wCMlmK5wTNxgOPiw.huge</a></p>
<p>on digPin2, then upload this code to your board:</p>
<p>int inPin=2;<br />
int pirVal=0;</p>
<p>void setup(){<br />
  pinMode(inPin, INPUT);<br />
  Serial.begin(9600);<br />
}</p>
<p>void loop(){<br />
  pirVal=digitalRead(inPin);<br />
  Serial.print(pirVal);<br />
}</p>
<p>and use the serial monitor window to verify that all is ok. More sophisticated code for checking change of state is here:</p>
<p><a href="http://make-documents.s3.amazonaws.com/fv1fYSLfy6QRgANM.pdf" rel="nofollow">http://make-documents.s3.amazonaws.com/fv1fYSLfy6QRgANM.pdf</a></p>
<p>To send the 1 or 0 to Max, change</p>
<p>Serial.print(pirVal);</p>
<p>to either</p>
<p>Serial,print(pirVal, BYTE);</p>
<p>or</p>
<p>Serial.write(pirVal);//if using latest version of Arduino IDE.</p>
<p>Bang the [serial] object in Max and you should see the data there, assuming you&#8217;ve matched baud rate and identified the correct port etc.</p>
<p>Search this forum for &#8220;Maxuino&#8221; and &#8220;Arduino2Max&#8221;; you&#8217;ll find that, in this situation, it is often better to roll your own patches than rely on prefabs like these &#8211; although SensorBox receives no complaints about usability/reliability. I personally don&#8217;t use any of them cos I&#8217;m total-n00bish and prefer to troubleshoot/hack my own code rather than someone else&#8217;s slightly more arcane/detailed code.</p>
<p>Brendan</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

