![]() If (pirVal = True): # check if the input is HIGH ![]() PirVal = GPIO.input(PIR) # read input value PirVal = False # we start, assuming no motion detected PirState = False # we start, assuming no motion detected This requires the AdafruitFritzing library. Using the Adafruit Raspberry Pi Cobbler, here’s how I connected the Raspberry Pi GPIO pins to the breadboard and wired up the PIR sensor and LEDĭownload the Fritzing diagram. The way this project works is by sensing motion using a PIR, Passive Infra-Red, sensor. ![]() I still use output to blink an LED, but now I also use input to decide when to blink the LED. Of course, the first project was to blink an LED!įor my second project, I decided to expand on the first. I purchased my first Raspberry Pi and since my interest is more in line with interacting with the physical than just having a small computer, I needed a second project. I have been using the Arduino for a few years now and recently curiosity got the better of me with the excitement around the Raspberry Pi.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |