Difference between revisions of "I2C LCD"

From
Jump to: navigation, search
(Code BMP!)
(Code BitmapDisplay.ino)
 
(27 intermediate revisions by 2 users not shown)
Line 20: Line 20:
  
 
[[File:Sparking LCD 1.png |200px]]
 
[[File:Sparking LCD 1.png |200px]]
 +
 +
=== Compatibilité ===
 +
 +
----
 +
 +
[[File:Seeeduino-nano-connect.png | 125px]]
 +
ou
 +
[[File:Seeeduino-nano-preview.png | 125px]]
 +
[[File:Sparking LCD 1.png | 125px]]
 +
 +
Seeeduino Nano, Port <b>i2C</b><br>
 +
i2C LCD
 +
 +
----
 +
 +
[[File:Seeeduino v4-2.jpg | 100px]]
 +
[[File:Sparking LCD 1.png | 125px]]
 +
 +
Seeeduino v4.2, Port <b>i2C</b><br>
 +
i2C LCD
 +
 +
----
  
 
=== Code Hello World! ===
 
=== Code Hello World! ===
Line 51: Line 73:
 
     while(1);//Wait for ever.  
 
     while(1);//Wait for ever.  
 
}
 
}
</pre>
+
</pre><br>
 +
 
 +
----
 +
 
 +
=== Code BitmapDisplay.ino ===
 +
 
 +
il faut ici 2 fichiers, autrement utiliser directement l'exemple<br>
 +
[[File:Tuzki ccp.png | 250px]]
  
=== Code BMP! ===
+
Pour ajouter le 2ème fichier, Aller sur Sketch, <b>Add File</b><br>
  
il faut ici 2 fichiers,
+
[[File:Add File IDE.png | 125px]]
[[File:Tuzki ccp.png | 100px]]
 
  
 
<pre>
 
<pre>
Line 89: Line 117:
 
</pre>
 
</pre>
  
[[File:LCD Tuzki Displayed.png | 150px]]
+
[[File:LCD Tuzki Displayed.png | 175px]]
 +
 
 +
----

Latest revision as of 21:48, 30 August 2025

I2C LCD[edit]

Caractéristiques[edit]

https://www.seeedstudio.com/I2C-LCD-With-universal-Grove-cable.html

https://github.com/SparkingStudio/I2C_LCD_library


168 caractères ASCII peuvent être affichés.
Affichage d'images bicolores 128 x 64.
Luminosité et contraste du rétroéclairage réglables.

Communication[edit]

interface I2C

Images[edit]

Sparking LCD 1.png

Compatibilité[edit]


Seeeduino-nano-connect.png ou Seeeduino-nano-preview.png Sparking LCD 1.png

Seeeduino Nano, Port i2C
i2C LCD


Seeeduino v4-2.jpg Sparking LCD 1.png

Seeeduino v4.2, Port i2C
i2C LCD


Code Hello World![edit]

#include <Wire.h>
#include <I2C_LCD.h>
I2C_LCD LCD;
uint8_t I2C_LCD_ADDRESS = 0x51; //Device address configuration, the default value is 0x51.

//For detials of the function useage, please refer to "I2C_LCD User Manual". 
//You can download the "I2C_LCD User Manual" from I2C_LCD WIKI page: http://www.seeedstudio.com/wiki/I2C_LCD


void setup(void)
{
    Wire.begin();         //I2C controller initialization.
}

void loop(void)
{
    LCD.CleanAll(WHITE);    //Clean the screen with black or white.
    delay(1000);            //Delay for 1s.

    //8*16 font size auto new line black character on white back ground.
    LCD.FontModeConf(Font_6x8, FM_ANL_AAA, BLACK_BAC); 

    LCD.CharGotoXY(0,0);       //Set the start coordinate.
    LCD.print("Hello World!");  //Display "Hello World!" on coordinate of (0, 10).

    while(1);//Wait for ever. 
}



Code BitmapDisplay.ino[edit]

il faut ici 2 fichiers, autrement utiliser directement l'exemple
Tuzki ccp.png

Pour ajouter le 2ème fichier, Aller sur Sketch, Add File

Add File IDE.png

#include <Wire.h>
#include <I2C_LCD.h>

I2C_LCD LCD;
extern GUI_Bitmap_t bmTuzki;       //Declare bitmap data package.
uint8_t I2C_LCD_ADDRESS = 0x51;  //Device address configuration, the default value is 0x51.

void setup(void)
{
    Wire.begin();         //I2C controller initialization.
}

void loop(void)
{
    LCD.CleanAll(WHITE);    //Clean the screen with black or white.
    delay(1000);            //Delay for 1s.

    //Display the boot Logo, open the backlight, chose the bitmap dispaly mode.
    //To display the characters, you need to set the mode to WM_CharMode.
    LCD.WorkingModeConf(ON, ON, WM_BitmapMode);

    //Display "bmTuzki" on coordinate of (30, 0).
    //Bitmap data package file generate method please refer to the 5.3 section of the "I2C_LCD User Manual".
    LCD.DrawScreenAreaAt(&bmTuzki, 30, 0);
    delay(5000);            //Delay for 5s.
    
    while(1); //Wait for ever.
}

LCD Tuzki Displayed.png