OLED_Display 0,96Zoll mit DHT22 Sensor und Atmega2560

Warum?
Ich habe für meine Spinne eine Platine entworfen und um sicher zu gehen, dass diese gerecht geht, teste ich zuerst das Display, dann den DHT22 Sensor, den Gyrometer, den Barometer, den Spannungsregler und dann die Servos. In diesem Artikel zeige ich den DHT22 Sensor mit dem Atmega2560 und dem 0,96Zoll OLED_Display, da ich um das Display zu Testen einfach das Programm aus dem Artikel benutzt habe:
SSD1306 OLED mit einem WEMO betreiben – TowiLab (towinet.de)
Beschreibung für dass Programm:
In diesem Artikel habe ich einen Code aus der „TinyDHT“ Library und dem oben Verlinktem Artikel geschrieben, dass mir die Daten vom DHT22 Groß in Grad Celsius am Display anzeigt.
Sachaltplan:

Programm:
/////////////////////////////////////////
// //
// DHT22 mit OLED und ATmega2560 //
// //
/////////////////////////////////////////
// Mehr zum Code unter www.Towinet.de
#include <Wire.h> //Füge "Wire.h" ein
#include <SPI.h> //Füge "SPI.h" ein
#include <Adafruit_GFX.h> //Füge "Adafruit_GFX.h" ein
#include <Adafruit_SSD1306.h> //Füge "Adafruit_SSD1306.h" ein
#include "DHT.h" //Füge "DHT.h" ein
#define SCREEN_WIDTH 128 // OLED display breite, in pixeln
#define SCREEN_HEIGHT 64 // OLED display hoehe, in pixeln
#define DHTPIN 6 //Definiere welcher Pin für den Sensor benutzt wird
#define DHTTYPE DHT22 //Definiere welcher DHT Typ das ist (DHT11, DHT12, DHT22,...)
#define OLED_RESET 0 // Reset pin
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // Zuordung der Pins fuer SDA und SCL am SSD1206 Display
DHT dht(DHTPIN, DHTTYPE);
const unsigned char towilab_logo [] PROGMEM = { // TowiLab Logo
0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc7, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc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xfc, 0xff, 0xbf, 0x0f, 0xc7, 0x00, 0x07, 0xff, 0x0e, 0x01, 0xc0,
0x01, 0xf8, 0x0f, 0xc1, 0xf8, 0x7d, 0xe7, 0xbe, 0x0f, 0xc7, 0x00, 0x0f, 0xff, 0x0e, 0x01, 0xc0,
0x01, 0xf8, 0x0f, 0xc1, 0xf8, 0x7d, 0xe7, 0xbe, 0x0f, 0xc7, 0x00, 0x1f, 0x87, 0x0e, 0x01, 0xc0,
0x01, 0xf8, 0x0f, 0xc1, 0xf8, 0x7d, 0xe7, 0xfe, 0x0f, 0xc7, 0x00, 0x1c, 0x07, 0x0e, 0x01, 0xc0,
0x01, 0xf8, 0x0f, 0xc1, 0xf8, 0x7f, 0xc3, 0xfe, 0x0f, 0xc7, 0x00, 0x1c, 0x07, 0x0e, 0x03, 0xc0,
0x01, 0xf8, 0x07, 0xe3, 0xf0, 0x3f, 0xc3, 0xfc, 0x0f, 0xc7, 0x00, 0x1c, 0x07, 0x0e, 0x03, 0x80,
0x01, 0xf8, 0x07, 0xff, 0xf0, 0x3f, 0xc3, 0xfc, 0x0f, 0xc7, 0x00, 0x1e, 0x1f, 0x0e, 0x07, 0x80,
0x01, 0xf8, 0x03, 0xff, 0xe0, 0x3f, 0xc3, 0xfc, 0x0f, 0xc7, 0xff, 0xcf, 0xff, 0x0f, 0xff, 0x00,
0x01, 0xf8, 0x01, 0xff, 0xc0, 0x1f, 0x81, 0xf8, 0x0f, 0xc7, 0xff, 0xcf, 0xf7, 0x0f, 0xfe, 0x00,
0x01, 0xf8, 0x00, 0x7f, 0x00, 0x1f, 0x81, 0xf8, 0x0f, 0xc7, 0xff, 0xc3, 0xc7, 0x0e, 0xfc, 0x00
};
void setup(){
dht.begin(); //Beginne mit dem DHT zu kommunizieren
Wire.begin(); //Beginne kommunication mit OLED Display
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Adresse des OLED's
display.clearDisplay(); //Display loeschen
display.drawBitmap(3, 20, towilab_logo, 122, 23, WHITE); //Logo zeichnen
display.display(); //Werte setzen
delay(2000); //Warte 2 Sekunden
}
void loop(){
float h = dht.readHumidity(); //Erstelle einen Integer Namens "h" der mit der gemessenen Luftfeuchtigkeit gleichgestellt wird
float t = dht.readTemperature(); //Erstelle einen Integer Namens "t" der mit der gemessenen Temperatur gleichgestellt wird
display.clearDisplay(); //Display loeschen
display.setTextSize(4); //Text groeße einstellen
display.setTextColor(WHITE); //Farbe einstellen
display.setCursor(0, 0); //Cursor setzen
display.print(h,1); //gebe den Wert "Feuchtigkeit" mit einer Nachkommastelle aus
display.print("%"); //gebe das "%" Zeichen aus
display.setCursor(255, 0); //Setze Körser auf die Mitte Links
display.print(t,1); //gebe den Wert "Feuchtigkeit" mit einer Nachkommastelle aus
display.print("C"); //gebe das "C" Zeichen aus
display.display(); //Werte setzen
}