Ces modules OLED ELECFREAKS IIC sont compacts, mais très lisibles grâce au contraste élevé d’un écran OLED. Cet écran est composé de 128 x 64 pixels OLED blancs individuels, chacun étant activé ou désactivé par la puce de contrôle. L’écran produisant sa propre lumière, aucun rétroéclairage n’est nécessaire. Cela réduit la consommation d’énergie nécessaire au fonctionnement de l’OLED et explique le contraste élevé de l’écran ; nous apprécions particulièrement la netteté de cet écran miniature !
L’OLED lui-même nécessite une alimentation 3,3 V et des niveaux logiques 3,3 V pour la communication, mais nous incluons un régulateur 3,3 V et toutes les broches sont entièrement décalées en niveau afin que vous puissiez l’utiliser avec des appareils 5 V !
CARACTÉRISTIQUES
L’OLED est auto-lumineux, sans rétroéclairage
Taille de l’écran : 0,96
Résolution : 128*64
Couleur : Bleu
Méthode de communication : IIC
Température de fonctionnement : -20-70
Tension de fonctionnement : 3,3-5 V
Taille du module : <27 mm * 28 mm
PROGRAMMTION
<syntaxhighlight lang=”php”>
- include <Wire.h>
// with no jumpers the full address is 1 0 0 1 1 1 1 0 0 A2 A1 A0 0x27 is the default address for the board with no jumpers.
- define PCA9555 0x27 // 0x27 is default address for the board with no jumpers.
// 0x20 is address for the board with all jumpers.
// COMMAND BYTE TO REGISTER RELATIONSHIP FROM PCA9555 DATA SHEET // At reset, the device’s ports are inputs with a high value resistor pull-ups to VDD // If relays turning on during power up are a problem. Add a pull down resistor to each relay transistor base.
- define IN_P0 0x00 // Read Input port0
- define IN_P1 0x01 // Read Input port1
- define OUT_P0 0x02 // Write Output port0
- define OUT_P1 0x03 // Write Output port1
- define INV_P0 0x04 // Input Port Polarity Inversion port0 if B11111111 is written input polarity is inverted
- define INV_P1 0x05 // Input Port Polarity Inversion port1 if B11111111 is written input polarity is inverted
- define CONFIG_P0 0x06 // Configuration port0 configures the direction of the I/O pins 0 is output 1 is input
- define CONFIG_P1 0x07 // Configuration port1 configures the direction of the I/O pins 0 is output 1 is input
- define PAUSE 200
void setup() {
delay(1000); display.initialize();
}
void loop() {
display.drawLine(0, 0, 127, 63,WHITE); display.update(); delay(1000); display.clear(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); display.println("Hello, world!"); display.setTextColor(BLACK, WHITE); // 'inverted' text display.println(3.141592); display.setTextSize(2); display.setTextColor(WHITE); display.print("0x"); display.println(0xDEADBEEF, HEX); display.update(); delay(2000); display.clear();
}
There are no reviews yet.