Compare commits
3 Commits
8c51bfb8e7
...
166cf42120
Author | SHA1 | Date | |
---|---|---|---|
166cf42120 | |||
ba0d786022 | |||
af062814cf |
38
content.txt
Normal file
38
content.txt
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
El kit Incluye:
|
||||||
|
1 x Placa de Desarrollo Uno R3 con Chip CH340
|
||||||
|
1 x Cable USB
|
||||||
|
65 x Jumpers Protoboard
|
||||||
|
1 x Protoboard de 830 puntos
|
||||||
|
15 x LEDs (Rojo, Verde, Amarillo)
|
||||||
|
30 x Resistencias (220, 10K, 1K)
|
||||||
|
10 x Dupont Macho-Hembra
|
||||||
|
1 x Potenciometro 10K
|
||||||
|
1 x Buzzer Activo
|
||||||
|
1 x Buzzer Pasivo
|
||||||
|
1 x 74HC595N (Shift register, chip suelto)
|
||||||
|
1 x Receptor Infrarrojo
|
||||||
|
1 x LM35DZ (temperatura)
|
||||||
|
1 x Sensor Llama (rojo con mic)
|
||||||
|
5 x Switches boton c/Tope
|
||||||
|
1 x Control Remoto Infrarrojo
|
||||||
|
1 x Display 1 digito
|
||||||
|
1 x Display 4 digitos
|
||||||
|
1 x Display Matrix 8x8
|
||||||
|
1 x Motor paso a paso de 5V
|
||||||
|
1 x Display LCD 1602
|
||||||
|
1 x Joystick PS2
|
||||||
|
1 x Sensor Digital de Temperatura y Humedad DHT11 (carcaza azul)
|
||||||
|
1 x Sensor de nivel de Agua (rojo largo)
|
||||||
|
1 x Modulo RFID
|
||||||
|
1 x Llavero RFID
|
||||||
|
1 x Tarjeta RFID
|
||||||
|
1 x Modulo sensor de Sonidos
|
||||||
|
1 x Modulo Relay de 1 canal
|
||||||
|
1 x Teclado matriz de 16 botones
|
||||||
|
1 x Modulo RGB de 3 colores
|
||||||
|
1 x Conector para batería de 9V
|
||||||
|
1 x Servo Motor SG90
|
||||||
|
1 x Modulo RTC
|
||||||
|
1 x Modulo Driver UNL2003 (plaquita con chip y leds)
|
||||||
|
1 x Sensor de inclinación (parece capacitor)
|
||||||
|
3 x Foto Resistencias
|
@ -19,7 +19,8 @@ const int DOOR_SENSOR_PIN = 13;
|
|||||||
int currentDoorState; // current state of door sensor
|
int currentDoorState; // current state of door sensor
|
||||||
int lastDoorState; // previous state of door sensor
|
int lastDoorState; // previous state of door sensor
|
||||||
bool isArmed = true;
|
bool isArmed = true;
|
||||||
bool muted = true;
|
bool muted = false;
|
||||||
|
bool ledOn = true;
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
@ -46,9 +47,19 @@ unsigned long lastTime;
|
|||||||
|
|
||||||
void showAlarm(bool fired)
|
void showAlarm(bool fired)
|
||||||
{
|
{
|
||||||
|
if(!ledOn)
|
||||||
|
{
|
||||||
|
offLed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(fired)
|
if(fired)
|
||||||
|
{
|
||||||
|
if(isArmed)
|
||||||
{
|
{
|
||||||
showRed();
|
showRed();
|
||||||
|
}else{
|
||||||
|
showYellow();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(isArmed)
|
if(isArmed)
|
||||||
@ -83,6 +94,11 @@ void handleIR(){
|
|||||||
Serial.println("Alarm is " + String(isArmed ? "Armed" : "Disarmed"));
|
Serial.println("Alarm is " + String(isArmed ? "Armed" : "Disarmed"));
|
||||||
// playTone();
|
// playTone();
|
||||||
break;
|
break;
|
||||||
|
case 70:
|
||||||
|
Serial.println("Led on/off");
|
||||||
|
ledOn=!ledOn;
|
||||||
|
showAlarm(false);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Serial.print("unk: ");
|
Serial.print("unk: ");
|
||||||
Serial.println(IrReceiver.decodedIRData.command);
|
Serial.println(IrReceiver.decodedIRData.command);
|
||||||
@ -107,6 +123,8 @@ void handleDoor(){
|
|||||||
if(!isArmed)
|
if(!isArmed)
|
||||||
{
|
{
|
||||||
Serial.println("Alarm is dissarmed, not fireing");
|
Serial.println("Alarm is dissarmed, not fireing");
|
||||||
|
delay(500);
|
||||||
|
showAlarm(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Serial.println("Alarm is armed, firing");
|
Serial.println("Alarm is armed, firing");
|
||||||
@ -116,6 +134,7 @@ void handleDoor(){
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (lastDoorState == HIGH && currentDoorState == LOW) { // state change: HIGH -> LOW
|
if (lastDoorState == HIGH && currentDoorState == LOW) { // state change: HIGH -> LOW
|
||||||
|
delay(500);
|
||||||
Serial.println("The door-closing event is detected");
|
Serial.println("The door-closing event is detected");
|
||||||
isArmed=true;
|
isArmed=true;
|
||||||
showAlarm(false);
|
showAlarm(false);
|
||||||
|
@ -7,7 +7,11 @@ setupLeds(){
|
|||||||
pinMode(ledVerde,OUTPUT);
|
pinMode(ledVerde,OUTPUT);
|
||||||
pinMode(ledAzul,OUTPUT);
|
pinMode(ledAzul,OUTPUT);
|
||||||
}
|
}
|
||||||
|
void offLed(){
|
||||||
|
digitalWrite(ledRojo,0);
|
||||||
|
digitalWrite(ledVerde,0);
|
||||||
|
digitalWrite(ledAzul,0);
|
||||||
|
}
|
||||||
void showRed(){
|
void showRed(){
|
||||||
digitalWrite(ledRojo,255);
|
digitalWrite(ledRojo,255);
|
||||||
digitalWrite(ledVerde,0);
|
digitalWrite(ledVerde,0);
|
||||||
|
Loading…
Reference in New Issue
Block a user