EasyManua.ls Logo

Keyestudio ESP32 - 5. Test Result; Project 17: Invasion Alarm; 1. Description

Keyestudio ESP32
344 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ESP32 Starter Kit
(continued from previous page)
if(yellow_key == 0){
while(1){ //whlie()loop
DigitalTube.displayFloatNum(item); //Digital tube displays the item value
item--; //item--equals to item = item - 1
delay(1000);
buzz_val = !buzz_val; //“”takes the inverse runner. invert buzz_val
digitalWrite(buzz,buzz_val);
if(item == 0){
digitalWrite(buzz,LOW);
break; //break to exit the loop
}
}
while(item==0){ //when itme=0, enter loop
DigitalTube.displayFloatNum(item); //Digital tube displays the item value
printByte(weep); //Display a crying face
int red_key = digitalRead(reset);
if(red_key == 0){
break;
}
}
}
}
5. Test Result
After connecting the wiring and uploading code, press blue button to add time, green to reduce and red to reset. Press
yellow button for counting down. When it is over, the bomb explodes.
8.5.18 Project 17: Invasion Alarm
1. Description
This invasion alarm system is able to detect invaders in houses or small offices and warn the host to take measures in
time.
In this project, the sensor monitors a certain area. Some device on Arduino board will trigger LED to light up and
buzzer to beep for caution if a movement is detected in that zone.
Virtually, this module features practicability, easy installation and low costs. With the exception of home and office, it
also applies to factories, warehouses and markets, which, to a large extent, protects property security.
104 Chapter 8. Arduino Tutorial

Table of Contents