#include <Arduino.h>
#include <SPI.h>
#include <SD.h>
#define BUZZER_PIN 23
#define SD_CS 26
#define MISO 32
#define SCK 33
#define MOSI 25
//MOSI auf DI und MISO auf DO.
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(BUZZER_PIN, OUTPUT);
SPI.begin(SCK,MISO,MOSI);
Serial.println("SPI initialized");
if (!SD.begin(SD_CS)) {
Serial.println("SD Card Mount Failed");
while (1);
}
Serial.println("SD started");
Serial.println("Receiver Setup complete.");
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
Serial.println("test");
tone(BUZZER_PIN, 2000, 200); // High tone for ACK, 2000 Hz for 200 milliseconds
noTone(BUZZER_PIN); // Stop tone
delay(1000);
tone(BUZZER_PIN, 2000, 200);
noTone(BUZZER_PIN); // Stop tone
delay(1000);
tone(BUZZER_PIN, 2000, 200);
noTone(BUZZER_PIN); // Stop tone
delay(1000);
}