Please help me, i already have the source code for control 1 PIR, but i stil don't know how to edit that source for controlling 2 PIR by using arduino uno
...but you forgot to post it.
What makes you think this is a bootloader issue?
Your post was MOVED to its current location as it is more suitable.
Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
Me neither. Please post your code.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2);
// TX3 RD 2
int pirsensor = 10;
int buzzer = 12;
int redled = 13;
void setup() {
randomSeed(analogRead(0));
Serial.begin(9600);
mySerial.begin(9600); // original 19200. while enter 9600 for sim900A
Serial.println(" logging time completed!");
pinMode(pirsensor, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(redled, OUTPUT);
digitalWrite(buzzer, LOW);
digitalWrite(redled, LOW);
delay(100);
}
void loop() {
if ( digitalRead(pirsensor) == HIGH)
{ digitalWrite(buzzer, HIGH);
digitalWrite(redled, HIGH);
Serial.println("making call");
mySerial.println("AT"); //Once the handshake test is successful, i t will back to OK
updateSerial();
mySerial.println("ATD+ +233240200044;"); // change ZZ with country code and xxxxxxxxxxx with phone number to dial
updateSerial();
delay(20000); // wait for 20 seconds...
mySerial.println("ATH"); //hang up
updateSerial();
delay(2000);
}
if ( digitalRead(pirsensor) == LOW)
{
digitalWrite(buzzer, LOW);
digitalWrite(redled, LOW);
;
delay(1000);
}
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
What do you want the second PIR to do?
What have you tried?
Please remember to use code tags when posting code.
What's the randomSeed for?
I want both of the pir sensor to control the buzzer
if ( digitalRead(pirsensor) == HIGH || digitalRead(pirsensor1) == 1)
will you declare the pirsensor
eg pinmode (pirsensor1);
and initiate
int pirsensor1 = 11
If you wrote the code for 1 PIR, just add the code for the 2nd PIR. ![]()
thanks
it work now
I see you have posted the same question again, twice. I have deleted both your new questions and given you a 2 day break from posting. Please use that break to familiarise yourself with the forum rules I linked to in reply #3.
Thank you.