CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 22:41:13 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=1ebb2b8a449ea15cecacef12527b64e90bb75226a9974f8d0d6bececb9694118a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22-_HTH0GkRgismaACl1KBrjv6DORrrFXp%22%3B%7D; HttpOnly; Path=/
cf-ray: 98da1a791cdc5ace-BLR
Sensor TERREMOTO ARDUINO - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <EEPROM.h>
- #include "EEPROMAnything.h"
- #include <LiquidCrystal.h>
- const int alarmPin = 5;
- const int relayPin = 10;
- int Xacc, Yacc, Zacc, threshold = 0, thresholdSET = 25;
- long debouncing_time = 15; //tiempo de rebote en milisegundos
- volatile unsigned long last_micros;
- LiquidCrystal lcd(12, 11, 9, 8, 7, 6);
- struct sensorValue
- {
- int X;
- int Y;
- int Z;
- };
- sensorValue acceleration;
- void debounceInterrupt_Increment()
- {
- if ((long)(micros() - last_micros) >= debouncing_time * 1000) {
- IncrementThreshold();
- last_micros = micros();
- }
- }
- void debounceInterrupt_Decrement()
- {
- if ((long)(micros() - last_micros) >= debouncing_time * 1000) {
- DecrementThreshold();
- last_micros = micros();
- }
- }
- void IncrementThreshold() {
- thresholdSET = EEPROM.read(500);
- thresholdSET++;
- EEPROM.write(500, thresholdSET);
- }
- void DecrementThreshold() {
- thresholdSET = EEPROM.read(500);
- thresholdSET--;
- EEPROM.write(500, thresholdSET);
- }
- void setup() {
- lcd.begin(16, 2);
- attachInterrupt(0, debounceInterrupt_Increment, RISING);
- attachInterrupt(1, debounceInterrupt_Decrement, RISING);
- pinMode(alarmPin, OUTPUT);
- pinMode(relayPin, OUTPUT);
- digitalWrite(relayPin, HIGH);
- EEPROM.write(500, thresholdSET);
- digitalWrite(alarmPin, LOW);
- lcd.setCursor(0, 0);
- lcd.print("Inicializando....");
- delay(5000);
- sensorValue acceleration = { analogRead(A0) , analogRead(A1) , analogRead(A2) };
- EEPROM_writeAnything(0, acceleration);
- EEPROM_readAnything(0, acceleration);
- lcd.clear();
- }
- void loop() {
- EEPROM_readAnything(0, acceleration);
- threshold = EEPROM.read(500);
- lcd.setCursor(0, 0);
- lcd.print("Modo monitor");
- lcd.setCursor(0,1);
- lcd.print("lÍMITE = ");
- lcd.print(threshold);
- Xacc = analogRead(A0);
- Yacc = analogRead(A1);
- Zacc = analogRead(A2);
- if ((Xacc >= (acceleration.X + threshold)) || (Xacc <= (acceleration.X - threshold))||(Yacc >= (acceleration.Y + threshold)) || (Yacc <= (acceleration.Y - threshold))||(Zacc >= (acceleration.Z + threshold)) || (Zacc <= (acceleration.Z - threshold))) {
- digitalWrite(relayPin, LOW);
- digitalWrite(alarmPin, HIGH);
- lcd.clear();
- lcd.setCursor(0, 0);
- lcd.print("PELIGRO !!!!!");
- lcd.setCursor(0,1);
- lcd.print("POR FAVOR EVACUAR");
- delay(5000);
- digitalWrite(relayPin, HIGH);
- digitalWrite(alarmPin, LOW);
- lcd.clear();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
📌 Swapzone +37% glitch ⭐ J
JavaScript | 2 sec ago | 0.25 KB
-
⭐⭐⭐Crypto Accounts⭐⭐
Java | 4 sec ago | 0.15 KB
-
⭐⭐⭐Free Giftcards Method⭐⭐
Java | 4 sec ago | 0.15 KB
-
⭐⭐⭐ChangeNOW Exploit⭐⭐
Java | 4 sec ago | 0.15 KB
-
💵 Make 3000$ in 20 minutes 💵
JavaScript | 10 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ 5
JavaScript | 12 sec ago | 0.25 KB
-
⭐⭐⭐Crypto Accounts⭐⭐
Java | 15 sec ago | 0.15 KB
-
⭐⭐⭐MAKE $9OO INSTANTLY D G⭐⭐
Java | 15 sec ago | 0.15 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand