PIR sensors
Morgan Anderson
Posts: 2
I'm working on a project for school currently and we have to make two robots communicate. I'm a beginner and havn't found much detail on sensors atleast at my level. So what i was thinking is using two PIR parallax sensors. How would i go about interfacing these to my robot which uses a 28 pin parallax BS2e, and what kind of code would i use?
Comments
Communication is easy: there are any number of wireless modules available, including a set that Parallax sells. Other popular choices are the Xbee family of radios.
The PIR sensor is quite easy too. It simply has two outputs: see movement or doesn't see movement (high or low). You can just hook it up to a pin and us INX where X is your pin number.
Take a look on the product pages for the sensors that you're looking at: they all have sample code for the BS2, but you don't need to change anything at all to use with the BS2e (except for the compiler directive)
Generally, you don't program peripherals like the PIR sensor or a wireless module. For the wireless, you'll probably send it commands and data via a SEROUT command, or maybe a SHIFTOUT command.
Like I said, take a look on the product pages from parallax. Sample code is generally available.