Entwicklungsumgebung

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 Date Who CommentSorted ascending
IDE_01.pngpng IDE_01.png manage 15 K 19 Jul 2020 - 09:59 DanielSchwab  
IDE_02.pngpng IDE_02.png manage 96 K 25 Jul 2021 - 09:03 DanielSchwab  
IDE_03.pngpng IDE_03.png manage 29 K 19 Jul 2020 - 11:09 DanielSchwab  
IDE_04.pngpng IDE_04.png manage 24 K 19 Jul 2020 - 11:12 DanielSchwab  
Topic revision: r6 - 20 Apr 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