Aduino Nano Fehler beim compilieren

"Hallo, beim compilieren bekomme ich Fehlermeldungen, ich bin neu hier und benötige Hilfe.

Fehlermeldung:
In file included from D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:29:0:
C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106-master/Adafruit_SH1106.h:141:7: error: redefinition of 'class Adafruit_SH1106'
class Adafruit_SH1106 : public Adafruit_GFX {
^~~~~~~~~~~~~~~
In file included from D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:23:0:
C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106-master/Adafruit_SH1106.h:141:7: note: previous definition of 'class Adafruit_SH1106'
class Adafruit_SH1106 : public Adafruit_GFX {
^~~~~~~~~~~~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:32:24: error: redefinition of 'Adafruit_SH1106 display'
Adafruit_SH1106 display(OLED_RESET);
^
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:27:17: note: 'Adafruit_SH1106 display' previously declared here
Adafruit_SH1106 display(OLED_RESET); // 1.3 INCH OLED DISPLAY INIT
^~~~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino: In function 'void setup()':
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:64:6: error: redefinition of 'void setup()'
void setup() {
^~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:109:6: note: 'void setup()' previously defined here
void setup() {
^~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino: In function 'void loop()':
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:175:6: error: redefinition of 'void loop()'
void loop() {
^~~~

D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:121:6: note: 'void loop()' previously defined here
void loop() {
^~~~

exit status 1

Compilation error: redefinition of 'Adafruit_SH1106 display'

Grüße Rainer"

Für Fehlermeldungen dieser Art braucht man den Code und auch die Version der IDE.

Weil entweder stimmt was mit der Libs nicht oder mit deren Aufruf bzw. ini.

Oder wie No.5 immer sagte : MEHR IMPUT :slight_smile:

Gruß

Pucki

Hallo @martinamandel ,

herzlich willkommen im Arduino-Forum.

Hallo martinamandel

Herzlich Willkommen im besten Arduino Forum.

Lade passend zum Fehlerbericht das Programm ins Forum.

Ja richtig und das macht man so:

irgendwas hast doppelt eingebunden oder doppelt angelegt.
Ohne Code schwierig zu finden.

Hallo, IDE ist 2.2.1
Da ich neu hier bin, kann ich noch keinen Code hochladen.
Das Projekt gibt es auf
`MoBa-Speed for Arduino - Modellgeschwindigkeit messen - N-Modellbahn

Grüße Rainer

FQBN: arduino:avr:nano
Using board 'nano' from platform in folder: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Verwendete Bibliotheken erkennen ...
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp -o nul
Alternativen für SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
  -> Kandidaten: [SPI@1.0]
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp -o nul
Alternativen für Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> Kandidaten: [Wire@1.0]
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp -o nul
Alternativen für Adafruit_GFX.h: [Adafruit GFX Library@1.11.9]
ResolveLibrary(Adafruit_GFX.h)
  -> Kandidaten: [Adafruit GFX Library@1.11.9]
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp -o nul
Alternativen für Adafruit_I2CDevice.h: [Adafruit BusIO@1.14.5]
ResolveLibrary(Adafruit_I2CDevice.h)
  -> Kandidaten: [Adafruit BusIO@1.14.5]
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp -o nul
Alternativen für Adafruit_SH1106.h: [Adafruit_SH1106]
ResolveLibrary(Adafruit_SH1106.h)
  -> Kandidaten: [Adafruit_SH1106]
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp -o nul
Using cached library dependencies for file: C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\Adafruit_SH1106.cpp
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src\SPI.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\Wire.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\utility\twi.c -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\Adafruit_GrayOLED.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\glcdfont.c -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO\Adafruit_BusIO_Register.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp -o nul
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106\Adafruit_SH1106.cpp -o nul
Funktionsprototypen werden generiert ...
C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO -IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp -o C:\Users\marti\AppData\Local\Temp\2955305258\sketch_merged.cpp
C:\Users\marti\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\marti\AppData\Local\Temp\2955305258\sketch_merged.cpp
Sketch wird kompiliert ...
"C:\\Users\\marti\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Users\\marti\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\marti\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\eightanaloginputs" "-IC:\\Users\\marti\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "-IC:\\Users\\marti\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\Wire\\src" "-IC:\\Users\\marti\\OneDrive\\Dokumente\\Arduino\\libraries\\Adafruit_GFX_Library" "-IC:\\Users\\marti\\OneDrive\\Dokumente\\Arduino\\libraries\\Adafruit_BusIO" "-IC:\\Users\\marti\\OneDrive\\Dokumente\\Arduino\\libraries\\Adafruit_SH1106" "C:\\Users\\marti\\AppData\\Local\\Temp\\arduino\\sketches\\985217E45CFE3DC94A67C5341617B732\\sketch\\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o "C:\\Users\\marti\\AppData\\Local\\Temp\\arduino\\sketches\\985217E45CFE3DC94A67C5341617B732\\sketch\\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp.o"
Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino\sketches\985217E45CFE3DC94A67C5341617B732\sketch\Adafruit_SH1106.cpp.o
In file included from D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:29:0:
C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106/Adafruit_SH1106.h:141:7: error: redefinition of 'class Adafruit_SH1106'
 class Adafruit_SH1106 : public Adafruit_GFX {
       ^~~~~~~~~~~~~~~
In file included from D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:23:0:
C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106/Adafruit_SH1106.h:141:7: note: previous definition of 'class Adafruit_SH1106'
 class Adafruit_SH1106 : public Adafruit_GFX {
       ^~~~~~~~~~~~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:32:24: error: redefinition of 'Adafruit_SH1106 display'
 Adafruit_SH1106 display(OLED_RESET);
                        ^
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:27:17: note: 'Adafruit_SH1106 display' previously declared here
 Adafruit_SH1106 display(OLED_RESET); // 1.3 INCH OLED DISPLAY INIT
                 ^~~~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino: In function 'void setup()':
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:64:6: error: redefinition of 'void setup()'
 void setup()   {
      ^~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:109:6: note: 'void setup()' previously defined here
 void setup()  {
      ^~~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino: In function 'void loop()':
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\sh1106_128x64_i2c.ino:175:6: error: redefinition of 'void loop()'
 void loop() {
      ^~~~
D:\Digikeijs\N-Modellbahn_MoBa-Speed_for_Arduino_V1-1_to_V1-4\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino:121:6: note: 'void loop()' previously defined here
 void loop()  {
      ^~~~

Bibliothek SPI in Version 1.0 im Ordner: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI  wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire  wird verwendet
Bibliothek Adafruit GFX Library in Version 1.11.9 im Ordner: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library  wird verwendet
Bibliothek Adafruit BusIO in Version 1.14.5 im Ordner: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO  wird verwendet
Bibliothek Adafruit_SH1106 im Ordner: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 (veraltet) wird verwendet
exit status 1

Compilation error: redefinition of 'Adafruit_SH1106 display'

Der Code wird

NICHT

hochgeladen
sondern gepostet wie die Fehlermeldungen

Das sind drei Mausklicks und zwei Tastendrücke fertig

Du machst das mit dem Code genauso wie mit dem Compiler-log
lies dazu dieses Tutorial

Hallo martinamandel

Nimm am Besten einen Compiler in der Version < 2.0.

Der Compiler verdaut ohne Warnungen und Fehlermeldungen dieses Programm:

// MoBa-Speed for ARDUINO
// powered by N-Modellbahn.de - Joerg Kiessling - 2018
// Arduino Sketch for model speed measurement 
// for Arduino Nano.V3, UNO.V3, MEGA
// 2 IR Line Trackers with LM393 komperator output
// Display OLED 128 x 64px
// Note1 for power supply: connect OLED display VDD to Arduino 3.3V !
// Note1 for OLED adresse: SSD1306_SWITCHCAPVCC, 0x3C is for third party products! Use adresse 0x3D for original Adafruit products!

// Digital sensor input Left and Right
#define SENSOR_L 7
#define SENSOR_R 6

////// DECLARATIONS
#include <SPI.h> // Not needed when using I2C
#include <Wire.h> //I2C library
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET 4
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // OLED DISPLAY INIT

//Distance from sensor Left to sensor Right - your distance (mm)
const double distance = 150.0; 

//Your model scale 1/xx
int scale = 160;

//Waiting time for train, to move out of measurement array (ms)
int waitingtime = 12000;

//Name of variables for time and speed measuring
long int deltatime, starttime;

//N-Modellbahn.de Logo - MoBa Speed for Arduino
const unsigned char PROGMEM logo [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x21, 0x81, 0x80, 0x03, 0xF0, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x21, 0xC1, 0x80, 0x03, 0xFC, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x63, 0xC3, 0xC0, 0x03, 0x0C, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x63, 0x62, 0xC3, 0xC3, 0x0C, 0x3E, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xE3, 0x66, 0xC7, 0xE3, 0xF8, 0x3F, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xE3, 0x34, 0xCE, 0x73, 0xFC, 0x03, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xE3, 0x34, 0xCC, 0x33, 0x06, 0x3F, 0x3E, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xE3, 0x3C, 0xCC, 0x33, 0x06, 0x7F, 0x3E, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x03, 0xE3, 0x18, 0xCE, 0x73, 0x0E, 0x63, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x03, 0xE3, 0x18, 0xC7, 0xE3, 0xFC, 0x7F, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x07, 0xE3, 0x00, 0xC3, 0xC3, 0xF8, 0x3F, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xE1, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x1F, 0xE3, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x3F, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x3F, 0xE3, 0x01, 0xF8, 0x1E, 0x0F, 0x07, 0xE0, 0x00,
0x7F, 0xFF, 0xE7, 0xFF, 0xFC, 0x00, 0x00, 0x7F, 0xE3, 0xC1, 0xFC, 0x3F, 0x1F, 0x8F, 0xE0, 0x00,
0x7F, 0xFF, 0xE7, 0xFF, 0xFE, 0x00, 0x00, 0x7F, 0xE1, 0xF1, 0x8E, 0x63, 0x31, 0x9C, 0x60, 0x00,
0x7F, 0xFF, 0xC3, 0xFF, 0xFE, 0x00, 0x00, 0xFF, 0xE0, 0x79, 0x86, 0x7F, 0x3F, 0x98, 0x60, 0x00,
0x7F, 0xFF, 0xC3, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xE0, 0x19, 0x86, 0x60, 0x30, 0x18, 0x60, 0x00,
0x7F, 0xFF, 0x81, 0xFF, 0xFF, 0x00, 0x01, 0xFF, 0xE0, 0x19, 0x8E, 0x72, 0x39, 0x1C, 0x60, 0x00,
0x7F, 0xFF, 0x81, 0xFF, 0xFF, 0x80, 0x01, 0xFF, 0xE3, 0xF9, 0xFC, 0x3E, 0x1F, 0x0F, 0xE0, 0x00,
0x7F, 0xFF, 0x00, 0xFF, 0xFF, 0x80, 0x03, 0xFF, 0xE3, 0xF1, 0xF8, 0x1C, 0x0E, 0x07, 0xE0, 0x00,
0x7F, 0xFF, 0x00, 0xFF, 0xFF, 0xC0, 0x03, 0xFF, 0xE0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFE, 0x00, 0x7F, 0xFF, 0xC0, 0x03, 0xFF, 0xE0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFE, 0x00, 0x7F, 0xFF, 0xE0, 0x07, 0xFF, 0xE0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFC, 0x00, 0x3F, 0xFF, 0xE0, 0x07, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xFC, 0x00, 0x3F, 0xFF, 0xF0, 0x0F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xF8, 0x00, 0x1F, 0xFF, 0xF0, 0x0F, 0xFF, 0xE1, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xF8, 0x00, 0x1F, 0xFF, 0xF8, 0x1F, 0xFF, 0xE3, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xF8, 0x00, 0x0F, 0xFF, 0xF8, 0x1F, 0xFF, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xF0, 0x00, 0x0F, 0xFF, 0xFC, 0x3F, 0xFF, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xF0, 0x00, 0x07, 0xFF, 0xFC, 0x3F, 0xFF, 0xE3, 0xE3, 0xC3, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xE0, 0x00, 0x07, 0xFF, 0xFE, 0x7F, 0xFF, 0xE3, 0xE7, 0xE3, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xE0, 0x00, 0x03, 0xFF, 0xFE, 0x7F, 0xFF, 0xE3, 0x0E, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xC0, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0x0C, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0xC0, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0x0C, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0x0E, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0x07, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE3, 0x03, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7F, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7E, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7E, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7E, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x7C, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xE0, 0x70, 0x00, 0x06, 0x00, 0x30, 0x00, 0x00,
0x7C, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xE0, 0x70, 0x00, 0x06, 0x00, 0x30, 0x00, 0x00,
0x78, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xE0, 0xD8, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x78, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xE0, 0xD8, 0x7C, 0x7E, 0x63, 0x33, 0xF0, 0x78,
0x70, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xE1, 0x8C, 0x7C, 0xFE, 0x63, 0x33, 0xF8, 0xFC,
0x70, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xE1, 0x8C, 0x61, 0xC6, 0x63, 0x33, 0x19, 0xCE,
0x60, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xE1, 0xFC, 0x61, 0x86, 0x63, 0x33, 0x19, 0x86,
0x60, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xE3, 0xFE, 0x61, 0x86, 0x63, 0x33, 0x19, 0x86,
0x40, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xE3, 0x06, 0x61, 0xC6, 0x63, 0x33, 0x19, 0xCE,
0x40, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xE6, 0x03, 0x60, 0xFE, 0x7F, 0x33, 0x18, 0xFC,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xE6, 0x03, 0x60, 0x7E, 0x3F, 0x33, 0x18, 0x78,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

void setup()  {
  //Sensor Input
  pinMode(SENSOR_L, INPUT_PULLUP); 
  pinMode(SENSOR_R, INPUT_PULLUP);

  //Interface baud rate
  Serial.begin(9600);

  //Display
  initialize_display();
}

void loop()  {
  //waiting for signal, sensor Left
  if (digitalRead(SENSOR_L)== LOW)
  {
    //Sensor Left was activated, start time = system time (ms)
    starttime = millis();
    
    //waiting for signal sensor Right
    while (digitalRead(SENSOR_R)== HIGH) {}
    
    //Measured time in ms
    deltatime = (millis() - starttime);
   
    refresh_display();
  }

  //waiting for signal, sensor Right 
  if (digitalRead(SENSOR_R)== LOW)
  {
    //Sensor Right was activated, start time = system time (ms)
    starttime = millis();
    
    //waiting for signal sensor Left
    while (digitalRead(SENSOR_L)== HIGH) {}
  
    //Measured time in ms
    deltatime = (millis() - starttime);
  
    refresh_display(); 
  }    
} //End of loop


//Output on display
void refresh_display() {
 
   //Output on serial monitor
   Serial.println("");
   Serial.println("Deltatime:");
   Serial.print(deltatime);
   Serial.println(" ms");
   Serial.println("---------");
   Serial.println("Speed:");
   Serial.print(distance/deltatime);
   Serial.println(" m/s (real)");
   Serial.print(scale*distance/deltatime*3.6, 0);
   Serial.print(" km/h (scale 1/");
   Serial.print(scale);
   Serial.println(")");



   

  //Output on OLED 
  display.clearDisplay();
  display.setTextSize(5);
  display.setCursor(0,28);
  display.print(scale*distance/deltatime*3.6, 0);  //calculating speed in km/h
  display.setTextSize(1);
  display.setCursor(91,56);
  display.print("km/h");
  display.setCursor(98,28);
  display.print("1/");
  display.setCursor(110,28);
  display.print(scale);
  display.drawFastHLine(0, 18, 128, WHITE);
  display.setTextSize(2);
  display.setCursor(0,0);
  display.print(deltatime*0.001);
  display.setTextSize(1);
  display.setCursor(50,7);
  display.print("s");
  display.drawFastVLine(63, 0, 16, WHITE);
  display.setTextSize(2);
  display.setCursor(71,00);
  display.print(distance/deltatime);
  display.setTextSize(1);
  display.setCursor(121,-2);
  display.print("m");
  display.drawFastHLine(121, 7, 5, WHITE);
  display.setCursor(121,8);
  display.print("s");
  display.display();

  delay(waitingtime);

  display.clearDisplay();
  display.setTextSize(4);
  display.setCursor(5,28);
  display.print("READY");
  display.drawFastHLine(0, 18, 128, WHITE);
  display.setTextSize(2);
  display.setCursor(37,0);
  display.print("1/");
  display.setCursor(60,0);
  display.print(scale);
  display.display();

  Serial.println("");
  Serial.println("<<< READY >>>");
}


void initialize_display() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize OLED display (use adresse 0x3D for original Adafruit product)
  display.display();
  display.clearDisplay();
  display.drawBitmap(0, 0, logo, 128, 64, WHITE);
  display.display();
  display.setTextColor(INVERSE);

  delay(2500);

  display.clearDisplay();
  display.setTextSize(1);
  display.setCursor(0,20);
  display.println("powered by");
  display.println("");
  display.print("www.N-Modellbahn.de");
  display.display();
  
  delay(2500);

  display.clearDisplay();
  display.setTextSize(4);
  display.setCursor(5,28);
  display.print("READY");
  display.drawFastHLine(0, 18, 128, WHITE);
  display.setTextSize(2);
  display.setCursor(37,0);
  display.print("1/");
  display.setCursor(60,0);
  display.print(scale);
  display.display();

  Serial.println("<<< READY >>>");
  
  
}

Du hast die Kopien falsch zusammen gesetzt. In deinem Sketch ist zwei mall void setup und void loop.

Hallo, das compilieren geht jetzt mit der älteren Version 1.8.18.
Nur bekomme ich das Programm nicht in die CPU, der COM-Port passt, die Einstellungen auch, es kommt folgendes:
Arduino: 1.8.18 (Windows 10), Board: "Arduino Nano, ATmega328P"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\marti\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\marti\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\marti\OneDrive\Dokumente\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10818 -build-path C:\Users\marti\AppData\Local\Temp\arduino_build_743098 -warnings=default -build-cache C:\Users\marti\AppData\Local\Temp\arduino_cache_103010 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\marti\OneDrive\Dokumente\Arduino\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\marti\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\marti\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\marti\OneDrive\Dokumente\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10818 -build-path C:\Users\marti\AppData\Local\Temp\arduino_build_743098 -warnings=default -build-cache C:\Users\marti\AppData\Local\Temp\arduino_cache_103010 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\marti\OneDrive\Dokumente\Arduino\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino

Using board 'nano' from platform in folder: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Using core 'arduino' from platform in folder: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o nul

Alternatives for Adafruit_GrayOLED.h: [Adafruit_GFX_Library@1.11.9]

ResolveLibrary(Adafruit_GrayOLED.h)

-> candidates: [Adafruit_GFX_Library@1.11.9]

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o nul

Alternatives for Adafruit_I2CDevice.h: [Adafruit_BusIO@1.14.5]

ResolveLibrary(Adafruit_I2CDevice.h)

-> candidates: [Adafruit_BusIO@1.14.5]

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o nul

Alternatives for Wire.h: [Wire@1.0]

ResolveLibrary(Wire.h)

-> candidates: [Wire@1.0]

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o nul

Alternatives for SPI.h: [SPI@1.0]

ResolveLibrary(SPI.h)

-> candidates: [SPI@1.0]

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o nul

Alternatives for Adafruit_SH1106.h: [Adafruit_SH1106]

ResolveLibrary(Adafruit_SH1106.h)

-> candidates: [Adafruit_SH1106]

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o nul

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\Adafruit_GrayOLED.cpp

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library\glcdfont.c

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO\Adafruit_BusIO_Register.cpp

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp

Using cached library dependencies for file: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\Wire.cpp

Using cached library dependencies for file: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\utility\twi.c

Using cached library dependencies for file: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src\SPI.cpp

Using cached library dependencies for file: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106\Adafruit_SH1106.cpp

Generating function prototypes...

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\preproc\ctags_target_for_gcc_minus_e.cpp"

"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\preproc\ctags_target_for_gcc_minus_e.cpp"

Sketch wird kompiliert...

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src" "-IC:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src" "-IC:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp" -o "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp.o"

Compiling libraries...

Compiling library "Adafruit_GFX_Library"

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\glcdfont.c.o

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\Adafruit_GrayOLED.cpp.o

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp.o

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o

Compiling library "Adafruit_BusIO"

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp.o

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp.o

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_BusIO\Adafruit_BusIO_Register.cpp.o

Compiling library "Wire"

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Wire\Wire.cpp.o

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Wire\utility\twi.c.o

Compiling library "SPI"

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\SPI\SPI.cpp.o

Compiling library "Adafruit_SH1106"

Zuvor kompilierte Datei wird verwendet: C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_SH1106\Adafruit_SH1106.cpp.o

Compiling core...

Using precompiled core: C:\Users\marti\AppData\Local\Temp\arduino_cache_103010\core\core_arduino_avr_nano_cpu_atmega328_dc5cb18b75a1832d0b85c27cc5d74aec.a

Linking everything together...

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\marti\AppData\Local\Temp\arduino_build_743098/N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.elf" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\sketch\N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\glcdfont.c.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\Adafruit_GrayOLED.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_BusIO\Adafruit_BusIO_Register.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Wire\Wire.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Wire\utility\twi.c.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\SPI\SPI.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098\libraries\Adafruit_SH1106\Adafruit_SH1106.cpp.o" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098/..\arduino_cache_103010\core\core_arduino_avr_nano_cpu_atmega328_dc5cb18b75a1832d0b85c27cc5d74aec.a" "-LC:\Users\marti\AppData\Local\Temp\arduino_build_743098" -lm

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\marti\AppData\Local\Temp\arduino_build_743098/N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.elf" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098/N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.eep"

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\marti\AppData\Local\Temp\arduino_build_743098/N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.elf" "C:\Users\marti\AppData\Local\Temp\arduino_build_743098/N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.hex"

Bibliothek Adafruit_GFX_Library in Version 1.11.9 im Ordner: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_GFX_Library wird verwendet

Bibliothek Adafruit_BusIO in Version 1.14.5 im Ordner: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_BusIO wird verwendet

Bibliothek Wire in Version 1.0 im Ordner: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire wird verwendet

Bibliothek SPI in Version 1.0 im Ordner: C:\Users\marti\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI wird verwendet

Bibliothek Adafruit_SH1106 im Ordner: C:\Users\marti\OneDrive\Dokumente\Arduino\libraries\Adafruit_SH1106 (legacy) wird verwendet

"C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\Users\marti\AppData\Local\Temp\arduino_build_743098/N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.elf"

Der Sketch verwendet 17412 Bytes (56%) des Programmspeicherplatzes. Das Maximum sind 30720 Bytes.

Globale Variablen verwenden 1728 Bytes (84%) des dynamischen Speichers, 320 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.

Wenig Arbeitsspeicher verfügbar, es können Stabilitätsprobleme auftreten.

C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM8 -b115200 -D -Uflash:w:C:\Users\marti\AppData\Local\Temp\arduino_build_743098/N-Modellbahn_MoBa-Speed_for_Arduino_V1-4_by-Bernhard_OLED_1-3.ino.hex:i

avrdude: Version 6.3-20190619

     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

     Copyright (c) 2007-2014 Joerg Wunsch



     System wide configuration file is "C:\Users\marti\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"



     Using Port                    : COM8

     Using Programmer              : arduino

     Overriding Baud Rate          : 115200

avrdude: ser_open(): can't set com-state for "\.\COM8"

avrdude done. Thank you.

Beim Hochladen des Sketches ist ein Fehler aufgetreten

CH xxxx Treiber für USB unter Windows installiert?
eventuell so eistellen

Hallo, der zeigt in der Fehlermeldung was mit 115200 Baud, wo kommt das her, welchen Programmer soll ich verwenden ?
MfG
Rainer

keinen :wink: lass so stehen wie in der IDE ist

 Using Programmer              : arduino

     Overriding Baud Rate          : 115200

kommt vom Programmer ist nix zu einstellen,
So am Rande nimm die IDE 1.8.19, deine hat ein dicken Windows Fehler mit der ist dein PC von außen gefährdet, angreifbar.

Mit anderem Kabel versucht, anderen USB Port nehmen.
wurde das probiert ?
Noch was zeig mall Link zum deinem Nano (kauf Quelle).
Es gab schon hier Probleme mit Nano wo der CH Chip auf der Unterseite war abgeschliffen nicht, lesbar den konnte man nicht über USB flashen, ist auf dem Chip was zum Lesen wen ja was

Ist das übliche Problem denke ich :wink:

Gilt für Windows:!!

Öffne den Geräte-Manager. Stecke den Arduino ein. Schaue dir die Com-Ports an. Nun ziehe den Arduino wieder ab. Schaue dir wieder die Com-Ports an.
Der com-Port der Fehlt ist der richtige.

Den trägst du in die IDE ein.

Normalerweise sollte die eingesetzte Baud-Rate OK sein.
Als Gerät wählst du i.d.R. Arduino-Nano mit OLD-BOOTLOADER aus.

Das sollte funktionieren.

Gruß

Pucki

Gar keinen. !!!!

Du sollst via Boardverwalter den Nano suchen, und dannauf OLD-Bootloader stellen.

Keine Ahnung ob es auch Nanos gibt die mit den anderen Bootloader-Einstellungen funktionieren. Meine wollen alle den Old-Bootloader haben. Die Bautrate kannst du runter setzen falls es Stress gibt. Das macht nix, dauert halt dann nur ein Tick länger.

In den Nano geschoben wird dein Sketch mit HOCHLADEN. !!!!! Das ist ein Button oben.

"Hochladen mit Programmer" ist was ganz anders. Das brauch man i.d.R. wenn das Ziel kein eingebauten USB-Port hat. Wie z.b. ein "nacken" Chip. Aber das ist was für Fortgeschrittene.

Gruß

Pucki

Es geht ganz einfach Nano ausstecken,
Werkzeuge öffnen kein Port wird angezeigt , neu einstecken Port wird sichtbar oder auch nicht.
Weis nicht ob du das damals gelesen hast mit den drei NANO, Port wurde angezeigt hochladen ging nicht da waren über 50 Post hier, Endeffekt über ISP wurden die bespielt

Bist Du geil auf Klicks oder warum bietest Du jetzt schon zum drtten Mal den Text von Dir wie Sauerbier an?

Das hier ist ein deutschsprachiger Forenteil.
Dafür gibt es eine offizielle Übersetzung

1 Like