salut/hello
name project: domestic gsm alarm
ARDUINO ONU V.3
GSM SHIELD
FR
je travail sur une alarme ayant 2 fonction:
alerte
remote control ( active/désactive l'alarme)
j'ai actuellement une erreur que je ne comprend pas que faut t-il faire ?
EN
I work with an alarm with 2 function:
alert
remote control (turn on / off the alarm)
I currently have an error that I do not understand, what to do?
l'erreur/ error
voici le code
/* (Domestic Alarm)
student project
GSM program with 2 function
- alert
- remote control
*/
// program by THOMAR DYLANN
#include <GSM.h>
#define PINNUMBER ""
GSM gsmAccess;
GSM_SMS sms;
// connnected device
const int mouvement = 4;
const int enableall = 13;
const int Alarmsound = 5;
const int Alarmsoundtime = 5000; // time for sound of alarm
//6 seconds in milliseconds
const unsigned int calibrationTime = 6000;
void setup() {
Serial.begin(9600);
pinMode(mouvement, INPUT);
pinMode(Alarmsound, OUTPUT);
pinMode(enableall, OUTPUT);
// connection state
boolean notConnected = true;
// calibrating
for (unsigned int i = 0; i < calibrationTime; i += Alarmsoundtime * 2); {
digitalWrite (Alarmsound, HIGH);
delay(Alarmsoundtime);
digitalWrite(Alarmsound, LOW);
delay(Alarmsoundtime);
{
}
void loop() {
// arduino send Alert sms to user
if (digitalRead(mouvement)) { //si on capte un mouvement
SMS.send("0690******", "ALERTE! un mouvement suspect est détecté!"); //envoie SMS d'alerte
Alarmsound(HIGH); //active sound in 5 seconds
delay(5000);
Alarmsound(LOW);
}
}
{
}
switch (Alarmsound) {
case 1:
if (SMS.available()) { //Si on a recu un SMS
if (SMS.read() == "on") {
enableall(HIGH); //sonne l'alarme pendant 5 secondes
SMS.send ("0690******", " L'alarme est activé");
delay(5000);
break;
case 2:
else if (SMS.read() == "off") {
enableall(LOW);
SMS.send ("0690******", " L'alarme est activé");
delay(5000);
break;
}
}
}
}