Make sure that the serial port isn’t blocked by another application, such as
a serial monitor window you forgot to close.
Exercises
• Build an automatic burglar alarm that shows a stop sign whenever
someone is too close to your computer.
4
Make the application as smart
as possible. It should have a small activation delay to prevent it from
showing a stop sign immediately when it’s started.
• The speed of sound depends not only on the temperature, but also on
humidity and atmospheric pressure. Do some research to find the right
formula and the right sensors. Use your research results to make the
circuit for measuring distances even more precise.
• Use an alternative technology for measuring distances—for example, an
infrared sensor. Try to find an appropriate sensor, read its data sheet,
and build a basic circuit so you can print the distance to the nearest
object to the serial port.
4. You can find a stop sign here:
http://en.wikipedia.org/wiki/File:Stop_sign_MUTCD.svg
.
Chapter 5. Sensing the World Around Us • 98
report erratum • discuss
www.it-ebooks.info