Difference between revisions of "Grove 16x2 LCD Series"
(→Code 2) |
(→Code 2) |
||
| Line 43: | Line 43: | ||
=== Code 2 === | === Code 2 === | ||
| − | Seeeduino-nano + I2c + 16x2 LCD White on Blue<br> | + | Seeeduino-nano + port I2c + 16x2 LCD White on Blue<br> |
cette combinaison fonctionne avec le code suivant : | cette combinaison fonctionne avec le code suivant : | ||
Revision as of 19:34, 14 June 2025
Contents
Grove - 16x2 LCD Series
16 Characters * 2 Lines
Operating Voltage : 3.3V / 5V
images
ici on utilise le White on Blue
liens externes
http://wiki.seeedstudio.com/Grove-16x2_LCD_Series LCD wiki Grove-16x2
https://www.seeedstudio.com/Grove-16x2-LCD-White-on-Blue.html Shop Grove-16x2_LCD
Connectique
interface : I2C-bus
I2C Adresse: 0X3E
https://wiki.myows.top/index.php?title=I2cScanner I2cScanner
on va chercher l'adresse I2C, on regarde sur l'écran série
Scanning...
I2C device found at address 0x3E !
done
c'est la même indiqué par le constructeur.
Librairie Seed-Studio
install an Arduino library
https://github.com/Seeed-Studio/Grove_LCD_RGB_Backlight Librairie
https://github.com/Seeed-Studio/Grove_LCD_RGB_Backlight/archive/master.zip Librairie fichier Zip
Code 2
Seeeduino-nano + port I2c + 16x2 LCD White on Blue
cette combinaison fonctionne avec le code suivant :
#include <Wire.h>
#include "rgb_lcd.h"
rgb_lcd lcd;
/*
const int colorR = 255;
const int colorG = 0;
const int colorB = 0;
*/
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
//lcd.setRGB(colorR, colorG, colorB);
// Print a message to the LCD.
lcd.print("hello, world!");
delay(1000);
}
void loop()
{
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
delay(100);
}
Code 3
https://github.com/johnrickman/LiquidCrystal_I2C Librairy
https://www.arduinolibraries.info/libraries/liquid-crystal-i2-c
#include <LiquidCrystal_I2C.h>
// I2C address of the LCD (check your specific LCD if it's different)
#define LCD_I2C_ADDRESS 0x01
// Define the LCD as an object
LiquidCrystal_I2C lcd(LCD_I2C_ADDRESS, 16, 2); // 16 columns, 2 rows
void setup() {
// Initialize the LCD
lcd.init();
// Turn on the backlight
// lcd.backlight();
// Optional: Set custom characters if needed
// lcd.createChar(0, custom_char_data);
// You can use the custom_char_data array from a tool like LCD-Character-Creator (https://maxpromer.github.io/LCD-Character-Creator/)
}
void loop() {
// Clear the LCD (optional)
lcd.clear();
// Set the cursor to the desired position (column, row)
// 0,0 is the top-left corner
lcd.setCursor(0, 0);
// Print text to the LCD
lcd.print("Hello, World!");
// Optionally, delay for a period
delay(2000);
}