Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente |
materiels:afficheurs:ard0_96 [2023/08/21 08:38] – phil | materiels:afficheurs:ard0_96 [2024/04/16 22:37] (Version actuelle) – phil |
---|
| |
===== 0,96" 128x64 OLED 2864 Display module - SSD1306 (I2C) ===== | ===== 0,96" 128x64 OLED 2864 Display module - SSD1306 (I2C) ===== |
[Mise à jour le 20/8/2023] | [Mise à jour le 16/4/2024] |
{{ :materiels:afficheurs:micpyardu.png?nolink|}} | {{ :materiels:afficheurs:micpyardu.png?nolink|}} |
| |
* **Lectures connexes** | * **Lectures connexes** |
* <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:graphique" target="_blank">Les afficheurs graphiques : généralités et primitives</a></html> | * <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:graphique" target="_blank">Les afficheurs graphiques : généralités et primitives</a></html> |
| * Bibliothèques - <html><a href="https://www.arduinolibraries.info/" target="_blank">Arduino Library List</a></html> |
* <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:libgfx" target="_blank">Bibliothèque - Adafruit GFX Graphics Library</a></html> | * <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:libgfx" target="_blank">Bibliothèque - Adafruit GFX Graphics Library</a></html> |
* <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:ada1107#x64_oled_featherwing_-_sh1107_3_buttons_i2c" target="_blank">Adafruit 1,3" 128x64 OLED FeatherWing - SH1107 + 3 buttons (I2C)</a></html> | * <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:ada1107#x64_oled_featherwing_-_sh1107_3_buttons_i2c" target="_blank">Adafruit 1,3" 128x64 OLED FeatherWing - SH1107 + 3 buttons (I2C)</a></html> |
La technologie OLED est utilisée dans des applications commerciales telles que les écrans pour téléphones mobiles et lecteurs multimédias portables, les autoradios et les appareils photo numériques, entre autres.\\ | La technologie OLED est utilisée dans des applications commerciales telles que les écrans pour téléphones mobiles et lecteurs multimédias portables, les autoradios et les appareils photo numériques, entre autres.\\ |
\\ | \\ |
L'écran **Gravity OLED 2864** est un module d'affichage autolumineux à **fond bleu**. La zone d'affichage est de **0,96"** et utilise une puce <html><a href="https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf" target="_blank" title="pdf">SSD1306</a></html>. Il prend en charge les communications **I2C** et les fréquences de rafraîchissement allant jusqu'à 60 Hz. Le module utilise l’interface commune Gravity I2C pour une utilisation plug and play simplifiée. <html><a href="https://www.dfrobot.com/wiki/index.php/Gravity:_I2C_OLED-2864_Display" target="_blank">DFRobot</a></html> | L'écran **Gravity OLED 2864** est un module d'affichage **monochrome** bleu sur fond noir. La zone d'affichage est de **0,96"** et utilise une puce <html><a href="https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf" target="_blank" title="pdf">SSD1306</a></html>. Il prend en charge les communications **I2C** et les fréquences de rafraîchissement allant jusqu'à 60 Hz. Le module utilise l’interface commune Gravity I2C pour une utilisation plug and play simplifiée. <html><a href="https://www.dfrobot.com/wiki/index.php/Gravity:_I2C_OLED-2864_Display" target="_blank">DFRobot</a></html> |
| |
* **Caractéristiques** | * **Caractéristiques** |
* **Tension d'alimentation** : 3,3V ~ 5V | * **Tension d'alimentation** : 3,3V ~ 5V |
* **Consommation maximale** : 20mA @ 3v | * **Consommation maximale** : 20mA @ 3v |
| * **Angle de vision: >160°** |
* **Dimensions** : 41.2x26.2x8mm | * **Dimensions** : 41.2x26.2x8mm |
| |
* **x** : position du point par rapport au côté gauche de l'écran. \\ | * **x** : position du point par rapport au côté gauche de l'écran. \\ |
* **y** : position du point par rapport au dessus de l'écran. \\ | * **y** : position du point par rapport au dessus de l'écran. \\ |
* **w** : largeur (du mot Width). \\ | * **w** : largeur (Width). \\ |
* **h** : hauteur (du mot Height). \\ | * **h** : hauteur (Height). \\ |
* **c** : couleur (1=point allumé, 0=point éteint) \\ | * **c** : couleur (1 = point allumé, 0 = point éteint) \\ |
| |
{{ :materiels:capteurs:environnement:code.png?nolink|}} | {{ :materiels:capteurs:environnement:code.png?nolink|}} |
| |
<pane id="tab-arduino"> | <pane id="tab-arduino"> |
<callout type="info" icon="true" title="Bibliothèque OakOLED">En programmation C, C++ l'utilisation des méthodes de la classe **Adafruit_GFX** sur cet afficheur peut se faire par l'intermédiaire de la bibliothèque **OakOLED**. Comme OakOLED dérive de <html><a href="https://learn.adafruit.com/adafruit-gfx-graphics-library/overview" target="_blank" title="Site Adafruit">Adafruit GFX Graphics</a></html> il suffit de créer un objet OakOLED pour accéder aux méthodes de Adafruit_GFX. | <callout type="info" icon="true" title="Bibliothèque Adafruit_SSD1306">En programmation C, C++ l'utilisation des méthodes de la classe **Adafruit_GFX** sur cet afficheur peut se faire par l'intermédiaire de la bibliothèque **Adafruit_SSD1306**. Comme Adafruit_SSD1306 dérive de <html><a href="https://learn.adafruit.com/adafruit-gfx-graphics-library/overview" target="_blank" title="Site Adafruit">Adafruit GFX Graphics</a></html> il suffit de créer un objet Adafruit_SSD1306 pour accéder aux méthodes de Adafruit_GFX. |
\\ \\ | \\ \\ |
**Installer** <html><a href="https://github.com/netguy204/OakOLED" target="_blank">OakOLED</a></html> avec le gestionnaire de bibliothèques de l'IDE. Les méthodes de la classe sont décrites <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:graphique" target="_blank"><b>ici</b></a></html>. | **Installer** <html><a href="https://github.com/adafruit/Adafruit_SSD1306" target="_blank">Adafruit_SSD1306</a></html> avec le gestionnaire de bibliothèques de l'IDE. Les méthodes de la classe sont décrites <html><a href="https://webge.fr/dokuwiki/doku.php?id=materiels:afficheurs:graphique" target="_blank"><b>ici</b></a></html>. |
</callout> | </callout> |
| |
//Exemple : "Hello World"// \\ \\ | //Exemple : "Hello World"// |
| {{ :materiels:afficheurs:affssd1306.png?nolink&300|}} |
<code cpp helloWorld.cpp> | <code cpp helloWorld.cpp> |
// Exemple d'utilisation de la bibliothèque OakOLED | // Exemple d'utilisation de la bibliothèque Adafruit_SSD1306 |
// Description : Affiche "hello, world" | // Description : Affiche "hello, world" |
| |
#include "Wire.h" // Bibliothèques nécessaires | // Bibliothèques nécessaire à l'afficheur |
#include "Adafruit_GFX.h" | #include <Adafruit_SSD1306.h> |
#include "OakOLED.h" | |
| // Constructeurs |
| Adafruit_SSD1306 oled = Adafruit_SSD1306(128, 32, &Wire); // Afficheur |
| |
OakOLED oled; // Construction d'un objet OakOLED | |
| |
void setup() { | void setup() { |
Serial.begin(115200); | // Initialisation |
oled.begin(); | oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Addresse=0x3C pour 128pxx32px |
| |
| // Configuration de l'affichage |
| oled.clearDisplay(); |
oled.setTextSize(1); | oled.setTextSize(1); |
oled.setTextColor(1); | oled.setTextColor(WHITE); |
oled.setCursor(0, 0); | |
| |
oled.println("Hello, World!"); | oled.println("Hello, World!"); // préparation du texte dans le buffer |
oled.display(); | oled.display(); // Transfert buffer -> afficheur |
} | } |
| |
| |
<pane id="tab-micropy"> | <pane id="tab-micropy"> |
| |
=== 2.1 Présentation === | === 2.1 Présentation === |
<callout type="info" icon="true" title="Bibliothèque SSD1306"><html>Les exemples de code de cette page ont été testés sur un afficheur <html><a href="https://www.gotronic.fr/art-module-oled-i2c-gravity-dfr0486-26805.htm" target="_blank">Gravity OLED-2864 (128x64) </a></html> de DFROBOT et un <html><a href="https://www.gotronic.fr/art-module-afficheur-oled-0-96-tf052-28511.htm" target="_blank">Module afficheur OLED 0,96'' TF052</a></html> connectés à un **ESP32** ou à un **Raspberry Pi Pico**. Ces afficheurs sont pilotés par un circuit SOLOMON SYSTECH <html><a href="https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf" target="_blank">SSD1306</a></html>. Sa mise en oeuvre nécessite une bibliothèque. \\ \\ | <callout type="info" icon="true" title="Bibliothèque SSD1306"><html>Les exemples de code de cette page ont été testés sur un afficheur <html><a href="https://www.gotronic.fr/art-module-oled-i2c-gravity-dfr0486-26805.htm" target="_blank">Gravity OLED-2864 (128x64) </a></html> de DFROBOT et un <html><a href="https://www.gotronic.fr/art-module-afficheur-oled-0-96-tf052-28511.htm" target="_blank">Module afficheur OLED 0,96'' TF052</a></html> connectés à un **ESP32** ou à un **Raspberry Pi Pico**. Ces afficheurs sont pilotés par un circuit SOLOMON SYSTECH <html><a href="https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf" target="_blank">SSD1306</a></html>. Sa mise en oeuvre nécessite une bibliothèque. \\ \\ |