MODERATOR ACTION:
- Added relevant information on title
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>
int varArmed = 0;
int varCount = 0;
int varSMS = 0;
void setup() {
// put your setup code here, to run once:
pinMode(0,OUTPUT); // pin 5 on IC - alarm output goes to horn relay
pinMode(1,INPUT); //pin 6 on IC - to door handle switches N/C low input
pinMode(2,OUTPUT); //pin 7 on IC - GPS trigger SMS notify
pinMode(3,INPUT); //pin 2 on IC - to door lock High pulse Turn on alarm
pinMode(4,INPUT); //pin 3 on IC - to door unlock High pulse Turn off alarm
digitalWrite(0,0); // Alarm off when powered up
}
void loop() {
// put your main code here, to run repeatedly:
if(varArmed == 0) {
//do nothing but wait until armed
if(digitalRead(3) == 1){ //when doors lock signal goes high temporarily, arm alarm
varArmed = 1;
}
}//end if
if(varArmed == 1) { //alarm armed routine
//digitalWrite(2,1); //armed led on
if(digitalRead(4) == 1){ //when doors unlock signal goes high temporarily, disarm alarm
varArmed = 0;
varSMS = 0;
}
//check to see if alarm is triggered
if(digitalRead(1) == 1){ // N/C switch opens pulling input high
//Alarm triggered routine
varSMS += 1;
digitalWrite(0,1);
if(varSMS < 6){digitalWrite(2,1);}//send SMS notification
delay(20);
digitalWrite(0,0);
digitalWrite(2,0);
delay(20);
digitalWrite(0,1);
delay(20);
digitalWrite(0,0);
delay(20);
digitalWrite(0,1);
delay(20);
digitalWrite(0,0);
delay(20);
}//end if for alarm routine
}//end if
}// end void loop
whats interrupts?
is this the one im looking for? https://store-usa.arduino.cc/products/arduino-uno-rev3The 328 from Atmel/Microship (runs same code, more I/O, memory.....)
https://www.microchip.com/en-us/product/ATmega328 Arduino UNO board.....
If you want a big stepup this part has multiple copies of many of these resources on
1 chip.
View attachment 195534
Regards, Dana.
Yes, but a lot cheaper here :
https://www.aliexpress.com/w/wholesale-arduino-uno.html?spm=a2g0o.best.search.0
If you need even more I/O Mega :
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?