

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF[
	<!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
	<!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
	<!ENTITY owl 'http://www.w3.org/2002/07/owl#'>
	<!ENTITY swivt 'http://semantic-mediawiki.org/swivt/1.0#'>
	<!ENTITY wiki 'http://https://wikifab.org/wiki/Special:URIResolver/'>
	<!ENTITY category 'http://https://wikifab.org/wiki/Special:URIResolver/Category-3A'>
	<!ENTITY property 'http://https://wikifab.org/wiki/Special:URIResolver/Property-3A'>
	<!ENTITY wikiurl 'https://wikifab.org/wiki/'>
]>

<rdf:RDF
	xmlns:rdf="&rdf;"
	xmlns:rdfs="&rdfs;"
	xmlns:owl ="&owl;"
	xmlns:swivt="&swivt;"
	xmlns:wiki="&wiki;"
	xmlns:category="&category;"
	xmlns:property="&property;">

	<owl:Ontology rdf:about="https://wikifab.org/wiki/Special:ExportRDF/Du_pixelart_sur_vos_écrans_OLED/fr">
		<swivt:creationDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2026-04-12T08:24:42+02:00</swivt:creationDate>
		<owl:imports rdf:resource="http://semantic-mediawiki.org/swivt/1.0"/>
	</owl:Ontology>
	<swivt:Subject rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Du_pixelart_sur_vos_écrans_OLED/fr">
		<rdf:type rdf:resource="http://https://wikifab.org/wiki/Special:URIResolver/Category-3ATutorials"/>
		<rdfs:label>Du pixelart sur vos écrans OLED</rdfs:label>
		<rdfs:isDefinedBy rdf:resource="https://wikifab.org/wiki/Special:ExportRDF/Du_pixelart_sur_vos_écrans_OLED/fr"/>
		<swivt:page rdf:resource="https://wikifab.org/wiki/Du_pixelart_sur_vos_écrans_OLED/fr"/>
		<swivt:wikiNamespace rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">0</swivt:wikiNamespace>
		<swivt:wikiPageContentLanguage rdf:datatype="http://www.w3.org/2001/XMLSchema#string">fr</swivt:wikiPageContentLanguage>
		<property:Area rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Art</property:Area>
		<property:Area rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Electronics</property:Area>
		<property:Area rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Play and Hobbies</property:Area>
		<property:Complete rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Published</property:Complete>
		<property:Cost rdf:datatype="http://www.w3.org/2001/XMLSchema#double">5</property:Cost>
		<property:Currency rdf:datatype="http://www.w3.org/2001/XMLSchema#string">EUR (€)</property:Currency>
		<property:Description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Le pixel art c'est cool ! si vous voulez le rendre encore plus rétro quoi de mieux qu'un petit écran OLED.
Nous allons voir comment créer nos propres images et les animer.</property:Description>
		<property:Difficulty rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Medium</property:Difficulty>
		<property:Duration rdf:datatype="http://www.w3.org/2001/XMLSchema#double">2</property:Duration>
		<property:Duration-2Dtype rdf:datatype="http://www.w3.org/2001/XMLSchema#string">hour(s)</property:Duration-2Dtype>
		<property:ExternalAttachmentsLinks rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://github.com/maditnerd/oled_xbm</property:ExternalAttachmentsLinks>
		<property:ExternalAttachmentsLinks rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://create.arduino.cc/editor/madnerd/0a94bf35-ada8-4695-9f56-d62ea2ed4cff/preview</property:ExternalAttachmentsLinks>
		<property:ExternalAttachmentsLinks rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://create.arduino.cc/editor/madnerd/f616433a-3f8a-483c-8ca2-6447dac0314c/preview</property:ExternalAttachmentsLinks>
		<property:ExternalAttachmentsLinks rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://create.arduino.cc/editor/madnerd/b4c53d85-5579-4953-89d4-29e0a3b4228c/preview</property:ExternalAttachmentsLinks>
		<property:ExternalAttachmentsLinks rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://create.arduino.cc/editor/madnerd/7deed5b1-6f4d-4cd6-b662-0e2a88a93974/preview</property:ExternalAttachmentsLinks>
		<property:Introduction rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Dessiner sur des écrans OLED ? Ça peut paraitre compliqué, mais avec un peu d'entrainement, on peut faire un paquet de choses comme son propre logo, voir de l'animation ou même des jeux vidéos !</property:Introduction>
		<property:IsTranslation rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</property:IsTranslation>
		<property:Language rdf:datatype="http://www.w3.org/2001/XMLSchema#string">fr</property:Language>
		<property:Licences rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Attribution (CC BY)</property:Licences>
		<property:Main_Picture rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Du_pixelart_sur_vos_écrans_OLED_pixelart_wiki.jpg</property:Main_Picture>
		<property:Material rdf:datatype="http://www.w3.org/2001/XMLSchema#string">- Microcontrôleur compatible avec u8g2 (arduino / esp8266 / esp32 etc...)

- Écran  OLED monochrome</property:Material>
		<property:Notes rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Si vous voulez être informés des prochains tutoriels suivez moi sur twitter : https://twitter.com/m4dnerd</property:Notes>
		<property:SourceLanguage rdf:datatype="http://www.w3.org/2001/XMLSchema#string">none</property:SourceLanguage>
		<property:Step_Content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Sauvegarder votre image au format XBM

&lt;div class="icon-instructions caution-icon"&gt;
&lt;div class="icon-instructions-icon"&gt;&lt;i class="fa fa-exclamation-triangle"&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="icon-instructions-text"&gt;Sauvegarder le aussi au format PNG, vous ne pourrez pas modifier votre fichier XBM avec Krita !&lt;/div&gt;
&lt;/div&gt;

Ouvrez le fichier XBM avec un éditeur de texte et changez le nom des variables

Fichier XBM
 #define _width 128
 #define _height 32
 static char _bits[] = {
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00... 
 };
Fichier logo.h
 #define logo_width 128
 #define logo_height 32
 static const unsigned char logo[] U8X8_PROGMEM = {
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00... 
 };</property:Step_Content>
		<property:Step_Content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">&lt;div class="icon-instructions idea-icon"&gt;
&lt;div class="icon-instructions-icon"&gt;&lt;i class="fa fa-lightbulb-o"&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="icon-instructions-text"&gt;Je vous conseille de garder le code du logo dans un fichier .h, ainsi il sera plus simple de lire votre code&lt;/div&gt;
&lt;/div&gt;

Nous allons utiliser la bibliothèque U8g2 (elle est compatible avec beaucoup d'écrans)
 #include &lt;Wire.h&gt; //I2C
 #include &lt;U8g2lib.h&gt;
 #include "logo.h"
 
 //I2C SSD1306 128x32 (search U8g2 examples for other display)
 U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
 
 void setup() {
  u8g2.begin(); //Start Screen
  drawLogo();
 }
 
 void loop() {
 }
 
 void drawLogo() {
  u8g2.firstPage();
  do {
    u8g2.drawXBMP(0, 0, logo_width, logo_height, logo);
  } while ( u8g2.nextPage() );
 }
J'ai aussi mis les fichiers PNG et XBM dans un dossier res/ dans mon code afin de savoir ce qu'il y a dans logo.h et de pouvoir le modifier ultérieurement.

Téléversez votre code et voilà !</property:Step_Content>
		<property:Step_Content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">&lt;div class="icon-instructions info-icon"&gt;
&lt;div class="icon-instructions-icon"&gt;&lt;i class="fa fa-info-circle"&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="icon-instructions-text"&gt;Tout le code est disponible sur github à cette adresse : https://github.com/maditnerd/oled_xbm&lt;/div&gt;
&lt;/div&gt;

Pour notre premier exemple, nous allons utiliser le logo d'hackster.io

Nous allons
* Redimensionner l'image en 128x32
* Redessiner l'image avec deux couleurs
* La convertir en XBM (code arduino)
&lt;div class="icon-instructions idea-icon"&gt;
&lt;div class="icon-instructions-icon"&gt;&lt;i class="fa fa-lightbulb-o"&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="icon-instructions-text"&gt;N'importe quel logiciel peut faire l'affaire, mais je recommande chaudement Krita : https://krita.org/en/&lt;/div&gt;
&lt;/div&gt;

Redimensionner l'image à la taille la plus proche de votre écran (128x32) : Image --&gt; '''Redimensionner l'image à une nouvelle taille'''

Puis augmenter la taille de votre canvas à 128x32 : Image --&gt; '''Redimensionner le tableau'''

Dans les préréglages des brosses, choisissez Pixel Art

Puis redessiner l'image.

&lt;div class="icon-instructions idea-icon"&gt;
&lt;div class="icon-instructions-icon"&gt;&lt;i class="fa fa-lightbulb-o"&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="icon-instructions-text"&gt;Appuyer sur X pour passer d'une couleur à l'autre.&lt;/div&gt;
&lt;/div&gt;</property:Step_Content>
		<property:Step_Content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Nous allons utiliser un écran 128x32 (les écrans en 128x64 sont aussi très répandus si vous voulez plus d'espace), il nous faut donc choisir une '''petite image.'''

Les sprites de la GameBoy sont très faciles à convertir, mais gardez à l'esprit que nous sommes limités au noir et blanc, là ou la gameboy est capable d'afficher 4 nuances de gris.

Vous pouvez télécharger des sprites sur https://www.spriters-resource.com/ comme point de départ.</property:Step_Content>
		<property:Step_Content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">MILLIS); 
 } 
 void loop(){ 
    if(tick.isExpired()){ 
        //ANIMATION ICI
        tick.repeat(); 
    } 
 }
Un dernier point, si nous voulons que notre image sorte de l'écran à droite et apparaisse lentement à gauche, nous devons aller plus loin que la largeur maximale de l'écran (128) , plus exactement (128+36), 36 étant la largeur de notre image.

Une fois l'image sortie de l'écran à droite, nous la faisons apparaitre à -36 afin de donner l'impression qu'elle apparait à gauche.
 void loop() {
  if (tick.isExpired()) {
    drawAnimation();
    pos_x = pos_x + X;
    if (pos_x &gt; OLED_WIDTH + cannon_width) {
      pos_x = -cannon_width;
    }
    tick.repeat();
  }
 }</property:Step_Content>
		<property:Step_Content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Une autre façon d'animer une image et d'utiliser plusieurs images.

Au lieu de changer la position X, nous allons utiliser une '''condition SWITCH''' et augmenter la valeur '''animation_state.'''
 void drawAnimation() {
  u8g2.firstPage();
  do {
    switch (animation_state) {
      case 0:
        u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_1);
        break;
      case 1:
        u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_2);
        break;
      case 2:
        u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_3);
        break;
      case 3:
        u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_4);
        break;
      case 4:
        u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_5);
        break;
      case 5:
        u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_6);
        break;
    }
  } while ( u8g2.nextPage() );
 }
Afin que notre animation soit complète, il nous faut l'inverser, pour cela, nous allons utiliser le booléen (vrai/faux) '''animation_direction''' afin que l'animation aille dans le sens inverse.
 drawAnimation();
    if (animation_direction) {
      animation_state--;
    } else {
      animation_state++;
    }
    if (animation_state == 5) {
      animation_direction = true;
    }
    if (animation_state == 0) {
      animation_direction = false;
    }
Si on combine les deux techniques, on peut créer des animations plus complexe : https://www.youtube.com/watch?v=iB52FujIK-A</property:Step_Content>
		<property:Step_Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Choisir son image</property:Step_Title>
		<property:Step_Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Convertir son image en pixel art</property:Step_Title>
		<property:Step_Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Convertir son pixel art en code arduino</property:Step_Title>
		<property:Step_Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Afficher votre image</property:Step_Title>
		<property:Step_Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Animation - Position</property:Step_Title>
		<property:Step_Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Animation - Images multiples</property:Step_Title>
		<property:Tags rdf:datatype="http://www.w3.org/2001/XMLSchema#string">arduino</property:Tags>
		<property:Tags rdf:datatype="http://www.w3.org/2001/XMLSchema#string">esp8266</property:Tags>
		<property:Tags rdf:datatype="http://www.w3.org/2001/XMLSchema#string">esp32</property:Tags>
		<property:Tags rdf:datatype="http://www.w3.org/2001/XMLSchema#string">oled</property:Tags>
		<property:Tags rdf:datatype="http://www.w3.org/2001/XMLSchema#string">u8g2</property:Tags>
		<property:Tags rdf:datatype="http://www.w3.org/2001/XMLSchema#string">pixel</property:Tags>
		<property:Tags rdf:datatype="http://www.w3.org/2001/XMLSchema#string">pixelart</property:Tags>
		<property:Type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Technique</property:Type>
		<property:VideoType rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Youtube</property:VideoType>
		<property:Display_title_of rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Du pixelart sur vos écrans OLED</property:Display_title_of>
		<property:Has_processing_error rdf:resource="&wiki;Du_pixelart_sur_vos_écrans_OLED/fr-23_ERR227b0543c08d09491ecaf76426c4caf7"/>
		<swivt:wikiPageModificationDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-12-09T10:31:21Z</swivt:wikiPageModificationDate>
		<property:Modification_date-23aux rdf:datatype="http://www.w3.org/2001/XMLSchema#double">2458826.9384375</property:Modification_date-23aux>
		<swivt:wikiPageSortKey rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Du pixelart sur vos écrans OLED</swivt:wikiPageSortKey>
		<property:Comments rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0</property:Comments>
		<property:Page_creator rdf:resource="&wiki;Utilisateur-3AFuzzyBot"/>
		<property:I_did_it rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0</property:I_did_it>
		<property:Favorites rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0</property:Favorites>
	</swivt:Subject>
	<swivt:Subject rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Du_pixelart_sur_vos_écrans_OLED/fr-23_ERR227b0543c08d09491ecaf76426c4caf7">
		<swivt:masterPage rdf:resource="&wiki;Du_pixelart_sur_vos_écrans_OLED/fr"/>
		<swivt:wikiNamespace rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">0</swivt:wikiNamespace>
		<property:Has_processing_error_text rdf:datatype="http://www.w3.org/2001/XMLSchema#string">[8,"smw-datavalue-property-invalid-character","Pour cette partie nous allons utiliser le boulet de cannon de Super Mario Bros.\n\nIl est possible d'animer votre pixel art de deux fa\u00e7ons :\n* Changer sa position\n* Utiliser plusieurs images\nDonc si nous voulons d\u00e9placer une image de gauche \u00e0 droite, il suffit juste de changer la position X non ?\n\nSi vous utilisez un Arduino Uno, \u00e7a va marcher, mais avec des cartes plus puissantes (comme l'ESP8266) votre animation '''va aller beaucoup trop vite!'''\n\nNous avons besoin de limiter le taux de rafraichissement de notre animation, nous pourrions utiliser un delay mais nous ne pourrions plus faire d'autres choses en m\u00eame temps.\n\nNous allons donc utiliser la biblioth\u00e8que '''AsyncDelay''' pour g\u00e9rer cela plus efficacement.\n #include \n const int FPS = 1000 \/ 30; \/\/30 FPS \n \n AsyncDelay tick; void setup(){ \n   tick.start(FPS, AsyncDelay","{"]</property:Has_processing_error_text>
		<swivt:wikiPageSortKey rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Du pixelart sur vos écrans OLED# ERR227b0543c08d09491ecaf76426c4caf7</swivt:wikiPageSortKey>
	</swivt:Subject>
	<owl:DatatypeProperty rdf:about="http://semantic-mediawiki.org/swivt/1.0#creationDate" />
	<owl:Class rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Category-3ATutorials" />
	<owl:ObjectProperty rdf:about="http://semantic-mediawiki.org/swivt/1.0#page" />
	<owl:DatatypeProperty rdf:about="http://semantic-mediawiki.org/swivt/1.0#wikiNamespace" />
	<owl:DatatypeProperty rdf:about="http://semantic-mediawiki.org/swivt/1.0#wikiPageContentLanguage" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AArea" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AComplete" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ACost" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ACurrency" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ADescription" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ADifficulty" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ADuration" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ADuration-2Dtype" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AExternalAttachmentsLinks" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AIntroduction" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AIsTranslation" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ALanguage" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ALicences" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AMain_Picture" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AMaterial" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ANotes" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ASourceLanguage" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AStep_Content" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AStep_Title" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ATags" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AType" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AVideoType" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3ADisplay_title_of" />
	<owl:ObjectProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AHas_processing_error" />
	<owl:DatatypeProperty rdf:about="http://semantic-mediawiki.org/swivt/1.0#wikiPageModificationDate" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AModification_date-23aux" />
	<owl:DatatypeProperty rdf:about="http://semantic-mediawiki.org/swivt/1.0#wikiPageSortKey" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AComments" />
	<owl:ObjectProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3APage_creator" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AI_did_it" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AFavorites" />
	<owl:ObjectProperty rdf:about="http://semantic-mediawiki.org/swivt/1.0#masterPage" />
	<owl:DatatypeProperty rdf:about="http://https://wikifab.org/wiki/Special:URIResolver/Property-3AHas_processing_error_text" />
	<!-- Created by Semantic MediaWiki, https://www.semantic-mediawiki.org/ -->
</rdf:RDF>