
keyestudio
www.keyestudio.cc
42
Experiment principle
When it's approaching a fire, the voltage value the analog port reads differs. If you use a multimeter,
you can know when there is no fire approaching, the voltage it reads is around 0.3V; when there is fire
approaching, the voltage it reads is around 1.0V, tthe nearer the fire, the higher the voltage.
So in the beginning of the program, you can initialize voltage value i (no fire value); Then,
continuously read the analog voltage value j and obtain difference value k=j-i; compare k with 0.6V
(123 in binary) to determine whether or not there is a fire approaching; if yes, the buzzer will buzz.
Sample program
Summary of Contents for Basic starter kit
Page 1: ...1 ...
Page 10: ...keyestudio www keyestudio cc 8 Connection for 2560 R3 ...
Page 17: ...keyestudio www keyestudio cc 15 Connection for 2560 R3 ...
Page 21: ...keyestudio www keyestudio cc 19 Connection for 2560 R3 ...
Page 25: ...keyestudio www keyestudio cc 23 Connection for 2560 R3 ...
Page 29: ...keyestudio www keyestudio cc 27 Connection for 2560 R3 ...
Page 39: ...keyestudio www keyestudio cc 37 Connection for 2560 R3 ...
Page 62: ...keyestudio www keyestudio cc 60 Connection for 2560 R3 ...
Page 66: ...keyestudio www keyestudio cc 64 Connection for 2560 R3 ...
Page 77: ...keyestudio www keyestudio cc 75 Manual for LED segment display ...
Page 78: ...keyestudio www keyestudio cc 76 Connection for R3 Connection for 2560 R3 ...
Page 90: ...keyestudio www keyestudio cc 88 Connection for 2560 R3 ...
Page 94: ...keyestudio www keyestudio cc 92 ...
Page 95: ...keyestudio www keyestudio cc 93 Connection for R3 Connection for 2560 R3 ...