Spielkonsole (kleines Display)

Schritt 1

20200104_233738-1-k.jpg 20200105_125505-k.jpg 20200105_125529-k.jpg

Schritt 2

Spielkonsole_02.png

Spielkonsole_02_a.png

Schritt 3

Spielkonsole_01.png

Schritt 4

Spielkonsole_03.png

Schritt 5

Spielkonsole_08.png

Schritt 6 (optional)

Spielkonsole_06.png

Schritt 7 (optional)

Spielkonsole_07.png

Schritt 8

20200107_132901-1-k.png 20200107_133128-1-k.png

Schritt 9 (optional)

Link: Arduino ISP

Schritt 10

Download

Im Menü auf Software, dann Downloads anklicken. Dort die Version für dein System herunterladen.

Libraries für den Arduboy herunterladen

Die Arduino Entwicklungsumgebung nun starten. Dann im Menü: "Manage Libraries..." anwählen.

IDE_01.png

Dann im Suchfeld: "arduboy" eingeben und alle aufgelisteten Libraries installieren. Mit der Maus auf das entsprechende Feld gehen, dann erscheint der Install Knopf.
Bitte darauf achten, dass die richtige Version installiert wird.

IDE_02.png

Den Programmcode anpassen

Das original Display ist ein SSD1306 und wir verwenden ein SH1106. Somit müssen im Programmcode ein paar Zeilen angepasst werden, damit die Spiele auf dem SSH1106 auch funktionieren.

Unter Windows sind die beiden Dateien im Ordner Dokumente zu finden:
Arduino\libraries\Arduboy2\src\Arduboy2core.cpp
Arduino\libraries\Arduboy\src\core\core.cpp

Bereits angepasste Dateien herunterladen und dann die alten Dateien durch diese ersetzen.

Arduboy 1.1.1 und Arduboy2 5.2.1

Arduboy 1.1.1 und Arduboy2 6.0.0

Oder wenn man den code selber anpassen möchte, muss im File: "Arduboy2core.cpp" folgende zwei Funktionen ersetzt werden:
void Arduboy2Core::paintScreen(uint8_t *image, bool clear)
{
   for (int8_t i = 7; i >= 0; i--)
   {
      LCDCommandMode();
      SPItransfer(0xB0 + i);   
      SPItransfer(0x02);
      SPItransfer(0x10);
      LCDDataMode();
       
      for (uint16_t j = 128; j > 0; j--)
      {
         if(clear) image[i*128+128-j] = 0;
         SPItransfer(image[i*128+128-j]);
      }
   }   
}

void Arduboy2Core::paintScreen(const uint8_t *image)
{ 
  for (int8_t i = 7; i >= 0; i--)
  {
    LCDCommandMode();
    SPItransfer(0xB0 + i);
    SPItransfer(0x02);
    SPItransfer(0x10);
    LCDDataMode();
    
    for (uint16_t j = 128; j > 0; j--)
        {
        SPItransfer(image[i*128+128-j]);
        }
  }
}

Im anderen File: "core.cpp" nur eine Funktion ersetzen:
void ArduboyCore::paintScreen(unsigned char image[])
{
    for (int8_t i = 7; i >= 0; i–-)
    {
    LCDCommandMode();
    SPI.transfer(0xB0 + i); // Set row
    SPI.transfer(0x02); // 0x02, Set lower column address (use 0x00 for SD1306 and 1309)
    SPI.transfer(0x10); // Set higher column address
    LCDDataMode();

      for (uint16_t j = 128; j > 0; j--)
      {
           SPI.transfer(image[i*128+128-j]);
      }

    }
}

Einstellungen für das Spiel

IDE_03.png

Den Port entsprechend Eurem System Einstellen. Bei mir war es der COM24.

IDE_04.png

Topic attachments
I Attachment Action Size DateSorted ascending Who Comment
Spielkonsole_07.pngpng Spielkonsole_07.png manage 256 K 20 Dec 2019 - 17:24 DanielSchwab  
Spielkonsole_01.pngpng Spielkonsole_01.png manage 319 K 20 Dec 2019 - 17:30 DanielSchwab  
20200104_233738-1-k.jpgjpg 20200104_233738-1-k.jpg manage 113 K 05 Jan 2020 - 11:31 DanielSchwab  
20191030_100716-1a.pngpng 20191030_100716-1a.png manage 304 K 05 Jan 2020 - 12:05 DanielSchwab  
IMG-20191114-WA0015a.pngpng IMG-20191114-WA0015a.png manage 367 K 05 Jan 2020 - 12:05 DanielSchwab  
20200105_125505-k.jpgjpg 20200105_125505-k.jpg manage 97 K 05 Jan 2020 - 12:08 DanielSchwab  
20200105_125529-k.jpgjpg 20200105_125529-k.jpg manage 48 K 05 Jan 2020 - 12:08 DanielSchwab  
20200106_122641-1.jpgjpg 20200106_122641-1.jpg manage 74 K 06 Jan 2020 - 11:44 DanielSchwab  
20200106_122931-1-k.pngpng 20200106_122931-1-k.png manage 463 K 06 Jan 2020 - 11:45 DanielSchwab  
20200106_144243-1-r-1.pngpng 20200106_144243-1-r-1.png manage 326 K 06 Jan 2020 - 16:14 DanielSchwab  
Spielkonsole_03.pngpng Spielkonsole_03.png manage 370 K 07 Jan 2020 - 13:05 DanielSchwab  
20200107_132901-1-k.pngpng 20200107_132901-1-k.png manage 119 K 12 Jan 2020 - 18:05 DanielSchwab  
20200107_133128-1-k.pngpng 20200107_133128-1-k.png manage 110 K 12 Jan 2020 - 18:06 DanielSchwab  
Spielkonsole_02.pngpng Spielkonsole_02.png manage 325 K 16 Oct 2020 - 18:34 DanielSchwab  
Spielkonsole_06.pngpng Spielkonsole_06.png manage 401 K 16 Oct 2020 - 18:40 DanielSchwab  
Spielkonsole_02_a.pngpng Spielkonsole_02_a.png manage 27 K 19 Oct 2020 - 07:40 DanielSchwab  
Spielkonsole_08.pngpng Spielkonsole_08.png manage 372 K 21 Mar 2022 - 10:09 DanielSchwab  
Spielkonsole_01.odgodg Spielkonsole_01.odg manage 1 MB 21 Mar 2022 - 10:14 DanielSchwab  
Spielkonsole_zum_drucken.odtodt Spielkonsole_zum_drucken.odt manage 2 MB 21 Mar 2022 - 10:14 DanielSchwab  
Topic revision: r34 - 21 Mar 2022, DanielSchwab
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback