So I tried it today an get
This is the new/real code:
sketch\src.ino.cpp.o:(.bss.display+0x0): multiple definition of `display'
sketch\master.cpp.o:(.bss.display+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board WiFi LoRa 32(V2).
I changed display.h to displayown.h, because I thought meybe there is a multiple use of the name...
src.ino
#include "master.h"
BBQ10Keyboard keyboard;
volatile bool dataReady = false;
char EPD_preview_buffer[MAX_MESSAGE_LENGTH];
int EPD_preview_buffer_pos = 0;
int EPD_preview_cursor_pos = 0;
char fifo[FIFO_SIZE];
int fifo_in_pos = 0;
int fifo_out_pos = 0;
int fifo_elements = 0;
int rowUpperEdge[] = {10, 26, 42, 58, 74, 90, 106, 122}; // Cursorposition for text with 1px
int rowLowerEdge[] = {11, 27, 43, 59, 75, 91, 107, 123}; // Cursorposition for text with 1px
int maxColChars = 21;
int mailboxGUILine = 0;
int initialized = 0;
String messagesLines[MAX_MESSAGES];
int messagesLinesCount = 7;
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("setup");
delay(100);
display.init(115200);
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE); // set the background to white (fill the buffer with value for white)
display.fillRect(0, 79, maxColChars*11 + 7, 1, GxEPD_BLACK); // Trennstrich horizontal
display.fillRect(maxColChars*11 + 7, 0, 1, display.height(), GxEPD_BLACK); // Trennstrich vertikal
}
while (display.nextPage());
delay(50);
Serial.println("setup display end");
}
void loop()
{
// ...
}
master.h
#ifndef MASTER_H
#define MASTER_H
#define MAX_MESSAGE_LENGTH 200
#define FIFO_SIZE 20
#include <Arduino.h>
#include "keyboard.h"
#include "displayown.h"
void printFIFO (char fifo[]);
void printArray (char a[], int s);
#endif
master.cpp
#include "master.h"
void printFIFO (char fifo[]) {
for (int i = 0; i < FIFO_SIZE; i++) {
Serial.printf("%c, ", fifo[i]);
}
Serial.println("");
}
void printArray (char a[], int s) {
for (int i = 0; i < s; i++) {
Serial.printf("%c, ", a[i]);
}
Serial.println("");
}
displayown.h
// Code from ZinggJM/GxEPD2^1.3.6
#ifndef DISPLAYOWN_H
#define DISPLAYOWN_H
#include <Arduino.h>
#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include "GxEPD2_display_selection_new_style.h"
#include "bitmaps/Bitmaps128x296.h" // 2.9" b/w
#define ENABLE_GxEPD2_GFX 0
#define ENABLE_GxEPD2_GFX 0
#define MAX_MESSAGES 10
#define MAILBOXGUI_LINES 5
#define MAX_EPD_PREVIEW_LINES 3
#define MAX_EPD_PREVIEW_ROWS 21
#define FIFO_SIZE 20
#define MAX_MESSAGE_LENGTH 200
#endif
keyboard.h
#ifndef KEYBOARD_H
#define KEYBOARD_H
#include <Arduino.h>
#include <BBQ10Keyboard.h>
#define KB_INTERRUPT_PIN 13 // Interrupt pin
// SDA = 21
// SCL = 22
#endif
I have no idea why this is not working...