In this tutorial we will review the I2C OLED display module of 0.91 inches with the SSD1306 OLED driver of the company MakerFocus With it we will develop a small project with Arduino mino pro, a relay module, a pushbutton, the ignition of a focus.
Description:
MakerFocus 2-Piece I2C 0.91-inch OLED Display Module with SSD1306 Driver
You can purchase these displays, at a low price on the MakerFocus page
MakerFocus 2Pcs I2C OLED Display Module 0.91 Inch I2C SSD1306 OLED Display Module
DISPLAY module OLED display, no backlighting, self-maintenance.
The performance of the display is better than the traditional LCD screen, also a lower consumption.
Specifications:
Controller
IC: SSD1306 Size: 0.91 inch OLED Resolution: 128 x 32
Size: 38*12mm Number of pins: 4-pin
Interface Type: IIC
interface Color Display: White/Blue
Pin Description:
GND: Power Ground
VCC: Power+ (DC 3.3 x 5v)
Operating Temperature: -40x85oC
SCL: SDA Clock Line: Data Line
OLED display, no backlighting, self-lighting, Display color: blue.
The display performance is better than the traditional LCD screen, also lower consumption; IIC (I2C communications) simplifies connections.
Use with Arduino, ESP8266, ESP32, STM32, etc. 3.3 to 5v voltage
You may be interested in projects in Arduino, pic, robotics, telecommunications, subscribe http://www.youtube.com/user/carlosvolt?sub_confirmation=1 videos with full source code and diagrams
Circuit
Project source code
Remember to install the U8g2lib library, the steps to do it, are the video above.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
// Canal de youtube http://www.youtube.com/user/carlosvolt?sub_confirmation=1 //Tik-Tok https://www.tiktok.com/@carlosvolt //https://www.instagram.com/carlosvolt_electronic_robotic #include <Arduino.h> #include <U8g2lib.h> #ifdef U8X8_HAVE_HW_SPI #include <SPI.h> #endif #ifdef U8X8_HAVE_HW_I2C #include <Wire.h> #endif int ledPin = 10;//Pin para el led o luz int botonPin = 2; //Pin para el pulsador int estadoBoton = 0; int estado = 0; U8G2_SSD1306_128X32_UNIVISION_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED void setup(void) { u8g2.begin();//Inicializamos el display // initialize the LED pin as an output: pinMode(ledPin, OUTPUT);// Inicializamos el pin 10 como salida(led) pinMode(botonPin, INPUT_PULLUP);//Inicializamos el pin 2 como entrada(botón) displayOled();//Lamado de la función, para arrancar el display con la leyanda "Luz: Off" } void loop(void) { estadoBoton = digitalRead(botonPin);//Leemos el pulsador para ver su estado //Enciende o apaga la luz if (estadoBoton == LOW) {//Si el pulsador está precionado se cumple esta condición estadoBoton = digitalRead(botonPin);//Leemos el estado del botón nuevamente if(estado ==0){//Si la variable estado es igual a 0 se cumple esta condición digitalWrite(ledPin, HIGH);// Encendemos el led estado = 1;//Asignamos el valor 1 a la variable "estado" displayOled(); } else{ digitalWrite(ledPin, LOW);//Enviamos esta cadena para apagar la luz estado = 0; displayOled(); } while(estadoBoton == LOW){ estadoBoton = digitalRead(2);//Se cumple esta condición mientras esté precionado el botón } } } //Visializar en el display el estado de la luz void displayOled(){ u8g2.firstPage(); do { u8g2.setFont(u8g2_font_ncenB10_tr); if(estado == 1){ u8g2.drawStr(0,24,"Luz: ON"); } if(estado == 0){ u8g2.drawStr(0,24,"Luz: Off"); } } while ( u8g2.nextPage() ); } |
⭐️ SUBSCRIBE: https://www.youtube.com/user/carlosvolt?sub_confirmation=1 (Don’t forget to activate the 🔔)
👉Secondary channel: https://www.youtube.com/channel/UCjES9aB4g1F3IQbAk2nWCZg
👉Instagram: https://www.instagram.com/carlosvolt_tutoriales/
👉Tik Tok: https://www.tiktok.com/@carlosvolt
👉Fanpage: https://www.facebook.com/rogerbitfanpage/
👉Facebook: https://www.facebook.com/groups/RogerBit
👉Twitter: https://twitter.com/rogerbit_
👉Donations by paypal https://goo.gl/824Dnm or donacion@rogerbit.com
👉Website: https://www.rogerbit.com
SUBSCRIBE TO OUR NEWSLETTERS, RECEIVE IN YOUR EMAIL THE MOST OUTSTANDING NEWS, JUST BY ENTERING YOUR EMAIL
[wysija_form id=”1″]
RECOMMENDED PROJECT