# data[].attributes.headline
재난 감지 빌딩 센서 테스트

# data[].attributes.subject
재난 감지 빌딩 센서 테스트

# data[].attributes.body
적외선 불꽃 감지 센서

#define SPARKSENSOR 33

void setup() {

pinMode(SPARKSENSOR, INPUT);

Serial.begin(9600);

}

void loop() {

if (digitalRead(SPARKSENSOR)) {

Serial.println("FIRE");

delay(300);

}

}

진동 감지 센서

#define SHOCKSENSOR 32

void setup(){

pinMode(SHOCKSENSOR , INPUT);

Serial.begin(9600);

}

void loop(){

if(digitalRead(SHOCKSENSOR )){

Serial.println("충격감지");

delay(100);

}

}

버저

#define BUZZER 18

int freq = 5000;

int buzzerChannel =0;

int resolution = 8;

void setup(){

ledcSetup(buzzerChannel,freq,resolution);

ledcAttachPin(BUZZER, buzzerChannel);

}

void loop(){

for(int i=480; i<=700; i++){

ledcWriteTone(buzzerChannel, i);

delay(9);

}

for(int i=700; i>=480; i--){

ledcWriteTone(buzzerChannel, i);

delay(9);

}

}

# data[].attributes.body
아이디 : Dosirak_4216593

비번: 30463445

# data[].attributes.body
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID ""
#define BLYNK_TEMPLATE_NAME ""
#define BLYNK_AUTH_TOKEN ""//자신의 정보 device info에서 붙여넣기



#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = BLYNK_AUTH_TOKEN;


char ssid[] = "";//와이파이 아이디 붙여넣기
char pass[] = "";//와이파이 비밀번호 정보 붙여넣기



#define BTN_ADMIN_CHECK 27 //관리자 확인 버튼
#define SHOCKSENSOR 32
#define SPARKSENSOR 33
#define BUZZER 18
int freq = 5000;
int buzzerChannel=0;
int resolution = 8;
BlynkTimer timer;
boolean fireDetect;
boolean shockDetect;
boolean adminCheck;
void disasterEvent() {
  if (digitalRead(SPARKSENSOR)) {
    fireDetect = true;
  }
  if (digitalRead(SHOCKSENSOR)) {
    shockDetect = true;
  }
  if (fireDetect) {
    Blynk.virtualWrite(V3, "화재 감지");
  } else if (shockDetect) {
    Blynk.virtualWrite(V4, "지진 감지");
  } else {
    Blynk.virtualWrite(V3, "재난 감지 작동 중");
    Blynk.virtualWrite(V4, "재난 감지 작동 중");
  }
  if (fireDetect) {
    ledcWriteTone(buzzerChannel, 500);
  }
  else if (shockDetect) {
    ledcWriteTone(buzzerChannel, 900);
  }
  else {
    ledcWriteTone(buzzerChannel, 0);
  }
  if (digitalRead(BTN_ADMIN_CHECK)) {
    shockDetect = false;
    fireDetect = false;
  }
}
void setup() {
  Serial.begin(9600);
  ledcSetup(buzzerChannel, freq, resolution);
  ledcAttachPin(BUZZER, buzzerChannel);
  pinMode(SPARKSENSOR, INPUT);
  pinMode(SHOCKSENSOR, INPUT);
  pinMode(BTN_ADMIN_CHECK, INPUT);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(200L, disasterEvent);
}
void loop() {
  Blynk.run();
  timer.run();
}

# data[].attributes.body
#define BLYNK_PRINT Serial

#define BLYNK_TEMPLATE_ID "" Blynk 에서 Device Info 에 있는 코드
#define BLYNK_TEMPLATE_NAME ""
#define BLYNK_AUTH_TOKEN ""

#include <WiFi.h>

#include <WiFiClient.h>

#include <BlynkSimpleEsp32.h>

char auth[] = BLYNK_AUTH_TOKEN;

char ssid[] = ""; // wifi 아이디

char pass[] = "";// wifi 비밀번호

#define BTN_SECURITY_MODE 23

#define BTN_ADMIN_CHECK 27

#define HALLSENSOR 15

#define PROXSENSOR 34

BlynkTimer timer;

boolean securityMode;

boolean doorOpen;

boolean windowOpen;

boolean adminCheck;

void securityEvent(){

  if (!digitalRead(HALLSENSOR)){

    windowOpen = true;

  }

  if (analogRead(PROXSENSOR)>4000){

    doorOpen = true;

  }

  if (digitalRead(BTN_SECURITY_MODE)){

    securityMode = !securityMode;

    windowOpen = false;

    doorOpen = false;

  }

  if (securityMode){

    if (windowOpen){

      Blynk.virtualWrite(V1,"창문 침입 감지");

    } else if (doorOpen){

      Blynk.virtualWrite(V2,"출입문 침입 감지");

    } else {

      Blynk.virtualWrite(V1,"창문 보안 작동중");

      Blynk.virtualWrite(V2,"출입문 보안 작동중");

    }

  } else {

    Blynk.virtualWrite(V1,"출입문 보안 해제 해제중");

    Blynk.virtualWrite(V2,"창문 보안 해제 해제중");

  }

  if (digitalRead(BTN_ADMIN_CHECK)){

    windowOpen = false;

    doorOpen = false;

  }

}

void setup(){

  Serial.begin(115200);

  pinMode(HALLSENSOR,INPUT);

  pinMode(BTN_SECURITY_MODE,INPUT);

  pinMode(BTN_ADMIN_CHECK,INPUT);

  Blynk.begin(auth,ssid,pass);

  timer.setInterval(200L,securityEvent);

}

void loop(){

  Blynk.run();

  timer.run();

}

# data[].attributes.body
/*************************************************************

  This is a simple demo of sending and receiving some data.
  Be sure to check out other examples!
 *************************************************************/

/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID           "TMPL6tDC4qkyu"
#define BLYNK_TEMPLATE_NAME         "Quickstart Template"
#define BLYNK_AUTH_TOKEN            "h_aGPtGykAhjdW425kB4Bdmyf2A2lZtY"

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Dosirak_421650";
char pass[] = "16064412";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  // You can also specify server:
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

# data[].attributes.body
#define BUTTON 23

void setup(){

pinMode(BUTTON,INPUT);

Serial.begin(9600);

}

void loop(){

int buttonState=digitalRead(BUTTON);

Serial.println(buttonState);

delay(100);

}

# data[].attributes.body
#define HALLSENSOR 15

void setup(){

pinMode(HALLSENSOR,INPUT);

Serial.begin(9600);

}

void loop(){

if (!digitalRead(HALLSENSOR)) {

Serial.println("자성감지");

delay(100);

}

else{

Serial.println("감지안됨");

delay(100);

}

}

# data[].attributes.body
12825792

# data[].attributes.body
#define PROXSENSOR 34

void setup(){

Serial.begin(9600);

}

void loop(){

int value = analogRead(PROXSENSOR);

Serial.println(value);

delay(100);

}

# data[].attributes.attachment_link.readable_text
VCP Drivers Features and Benefits

The CP210x USB to UART Bridge Virtual COM Port (VCP) drivers are required for device operation as a Virtual COM Port to facilitate host communication with CP210x products. These devices can also interface to a host using the direct access driver.

These drivers are static examples detailed in Application Note 197: The Serial Communications Guide for the CP210x.

The CP210x Manufacturing DLL and Runtime DLL have been updated and must be used with v 6.0 and later of the CP210x Windows VCP Driver. Application Note Software downloads affected are AN144SW.zip, AN205SW.zip and AN223SW.zip. If you are using a 5.x driver and need support you can download Legacy OS Software.

# data[].attributes.attachment_link.title
CP210x USB to UART Bridge VCP Drivers - Silicon Labs

# data[].attributes.attachment_link.description
The CP210x USB to UART Bridge Virtual COM Port (VCP) drivers are required for device operation as a Virtual COM Port to facilitate host communication with CP210x products. These devices can also interface to a host using the direct access driver.

# data[].attributes.body
#define BLYNK_TEMPLATE_ID "TMPL6tDC4qkyu" #define BLYNK_TEMPLATE_NAME "Quickstart Template" #define BLYNK_AUTH_TOKEN "3N1Yx3T4V2tc_kn3HKUfKhTzQdxxptI9"

# data[].attributes.body
#define BLYNK_TEMPLATE_ID "TMPL6tDC4qkyu" #define BLYNK_TEMPLATE_NAME "Quickstart Template" #define BLYNK_AUTH_TOKEN "3N1Yx3T4V2tc_kn3HKUfKhTzQdxxptI9"

# data[].attributes.body
#define BLYNK_TEMPLATE_ID "TMPL6M9g8E34Z" #define BLYNK_TEMPLATE_NAME "Quickstart Template" #define BLYNK_AUTH_TOKEN "SWSmP_sCNdL66DpzMLHHoSB2nhqiitno"

# data[].attributes.body
#define SPARKSENSOR 33

void setup() {

pinMode(SPARKSENSOR, INPUT);

}

void loop() {

if (digitalRead(SPARKSENSOR)) {

Serial.println("FIRE");

delay(300);

}

}

# data[].attributes.body
#define BLYNK_TEMPLATE_ID "TMPL6QT2-rAdA" #define BLYNK_TEMPLATE_NAME "Quickstart Template" #define BLYNK_AUTH_TOKEN "VnWxdyomnPJz-s_EO9OlcBJo61a2ukIA"

# data[].attributes.body
#define BLYNK_TEMPLATE_ID "TMPL6ULyKGph9" #define BLYNK_TEMPLATE_NAME "Quickstart Template" #define BLYNK_AUTH_TOKEN "_P50pRkGNcnmNvhZ3cwaN4Vn8BH8V6GM"

# data[].attributes.body
#define BUZZER 18

int freq = 5000;

int buzzerChannel =0;

int resolution = 8;

voidsetup(){

ledcSetup(buzzerChannel,freq,resolution);

ledcAttachPin(BUZZER, buzzerChannel);

}

void loop(){

for(int i=480; i<+700; i++){

ledcWriteTone(buzzerChannel, i);

delay(9);

}

for(int i=700; i>=480; i--){

ledcWriteTone(buzzerChannel, i);

delay(9);

}

}

# data[].attributes.body
#define SPARKSENSOR 32

void setup() {

pinMode(SPARKSENSOR, INPUT);

Serial.begin(9600)

}

void loop(){

if (digitalRead(SPARKSENSOR)){

Serial.printlm("충격감지");

delay(100);

}

}

# data[].attributes.body
#define SPARKSENSOR 33


void setup(){
  pinMode(SPARKSENSOR,INPUT);
  Serial.begin(9600);
}


void loop(){
  if (digitalRead(SPARKSENSOR)){
    Serial.println("FIRE");
    delay(300);
  }
}

# data[].attributes.headline
진짜 2418 조재영입니다

# data[].attributes.subject
진짜 2418 조재영입니다