Arduino and Raspberry Pi Sensor Projects for the Evil Genius by Robert Chin
Author:Robert Chin
Language: eng
Format: epub, pdf
Publisher: McGraw-Hill Education
Published: 2017-08-21T04:00:00+00:00
Setting Up the Hardware
To build this hands-on example project, you will need to:
Connect the GND pin on the flame sensor to a GND pin of the Raspberry Pi.
Connect the VCC pin on the flame sensor to a 3.3-V pin of the Raspberry Pi.
Connect the DOUT pin on the flame sensor to pin 14 of the Raspberry Pi (Figure 5-12).
Figure 5-12
Raspberry Pi flame sensor test.
Setting Up the Software
The program for this example project tests the flame sensor by:
1. Importing the RPi.GPIO library.
2. Assigning pin 14 of the Raspberry Pi to the output pin on the flame sensor, which is represented by the FlameOutPin variable.
3. Initializing RawValue, which is the variable that reads data from the flame sensor to 0.
4. Setting the general-purpose input-output (GPIO) pin numbering system to BCM mode.
5. Setting the FlameOutPin as an input pin so that data from the flame sensor can be read.
6. Printing a message to the terminal indicating that the program has started running.
7. Doing the following until a keyboard interrupt has been detected:
a. Read the value from the flame sensor output pin.
b. If the value read is 0, then a flame has been detected, so print out a message to the terminal indicating that a flame was found.
c. If the value read is not 0, then no flame is detected, so print out a message to the terminal indicating that no flame was found.
8. Print out the raw value read from the flame sensor in step 1.
Download
Arduino and Raspberry Pi Sensor Projects for the Evil Genius by Robert Chin.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Pale Blue Dot by Carl Sagan(4601)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(4020)
Pocahontas by Joseph Bruchac(4018)
Unfiltered by Lily Collins(3900)
The Emotionary: A Dictionary of Words That Don't Exist for Feelings That Do by Eden Sher(3210)
The Daily Stoic by Holiday Ryan & Hanselman Stephen(3097)
Factfulness_Ten Reasons We're Wrong About the World_and Why Things Are Better Than You Think by Hans Rosling(3039)
The President Has Been Shot!": The Assassination of John F. Kennedy by Swanson James L(2963)
Sapiens and Homo Deus by Yuval Noah Harari(2833)
Rogue Trader by Leeson Nick(2818)
The 48 laws of power by Robert Greene & Joost Elffers(2776)
The Rape Of Nanking by Iris Chang(2641)
Almost Adulting by Arden Rose(2580)
Gettysburg by Iain C. Martin(2568)
500 Must-Know AP Microeconomics/Macroeconomics Questions(2471)
The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution by Walter Isaacson(2411)
The Plant Paradox by Dr. Steven R. Gundry M.D(2411)
In the Woods by Tana French(2385)
Make by Mike Westerfield(2197)
