online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <SoftwareSerial.h> #include <WiFi.h> #define PIR_PIN 27 #define BUZZER_PIN 26 // SIM800L GSM module #define SIM800_TX_PIN 17 #define SIM800_RX_PIN 16 const char* ssid = "your_SSID"; const char* password = "your_PASSWORD"; const char* phoneNumber = "your_phone_number"; SoftwareSerial sim800lSerial(SIM800_TX_PIN, SIM800_RX_PIN); void setup() { Serial.begin(115200); sim800lSerial.begin(9600); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting to WiFi..."); } Serial.println("Connected to WiFi."); pinMode(PIR_PIN, INPUT); pinMode(BUZZER_PIN, OUTPUT); } void loop() { // Check for motion if (digitalRead(PIR_PIN) == HIGH) { triggerAlarm(); sendSMS("Motion detected!"); delay(5000); // Wait for 5 seconds to avoid sending multiple messages } } void triggerAlarm() { digitalWrite(BUZZER_PIN, HIGH); delay(2000); // Buzzer duration (in milliseconds) digitalWrite(BUZZER_PIN, LOW); } void sendSMS(const String& message) { sim800lSerial.println("AT+CMGF=1"); // Set SMS mode to text delay(100); sim800lSerial.print("AT+CMGS=\""); sim800lSerial.print(phoneNumber); sim800lSerial.println("\""); delay(100); sim800lSerial.print(message); delay(100); sim800lSerial.write(26); // Ctrl+Z to send the message delay(100); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue