Professional Documents
Culture Documents
h>
void setup() {
// Initialize the serial communication with the computer
Serial.begin(9600);
void loop() {
// Check if motion is detected by the PIR motion sensor
if (digitalRead(pirPin) == HIGH) {
// Motion detected, send an SMS message
sendSMS(phoneNumber, "Motion detected!");
}
delay(1000);
}