// Simulation of Transceiver without LoRa Module or PIR sensor
int simulatedSensor = 0; // We'll toggle this value to simulate sensor behavior
void setup() {
Serial.begin(115200);
Serial.println("Simulated Transceiver Ready...");
}
void loop() {
// --- TRANSMITTER PART (Simulated) ---
// Toggle sensor value to simulate motion and no motion
simulatedSensor = !simulatedSensor; // Switch between 0 and 1
Serial.print("Transmitting PIR Value: ");
Serial.println(simulatedSensor);
delay(1000); // Simulate transmission delay
// --- RECEIVER PART (Simulated) ---
Serial.println("Switching to Receive Mode...");
delay(500); // Simulate waiting time for a packet
// "Receive" the simulated sensor value
int receivedValue = simulatedSensor;
Serial.print("Received PIR Sensor Value: ");
if (receivedValue == 1) {
Serial.println("Motion Detected");
} else if (receivedValue == 0) {
Serial.println("No Motion");
} else {
Serial.println("Invalid Data");
}
delay(2000); // Wait before starting next cycle
}