Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By jifopy
#30696 Hey guys, I'm looking to hookup an LCD 1602 I2C module to my nodeMCU running arduino IDE. my question is which pins do I use to hook it up if I can hook it up at all?

Below is some example code I have for it.

Code: Select all/* FILE:    ARD_LCD_HCARDU0023_I2C_Hello_World_Example.pde
   DATE:    07/09/12
   VERSION: 0.1

This is a simple example of how to use the Hobby Components I2C LCD module
(HCARDU0023). To use this module you will require the appropriate library
which can be downloaded from the modules section of our support forum at the
following location:

http://forum.hobbycomponents.com
 
This code also demonstrates the correct pin assignment for the LCD. When you
run this program you should see a greeting message appear on the display.


DEVICE PINOUT (SPI Interface):

PIN 1: GND
PIN 2: +5V
PIN 3: SDA - Connect to Arduino analogue PIN 4
PIN 4: SCL - Connect to Arduino analogue PIN 5


You may copy, alter and reuse this code in any way you like but please leave
reference to hobbycomponents.com in your comments if you redistribute this code. */


/* Include the SPI/IIC Library */
#include <Wire.h>
#include <LiquidCrystal_I2C.h>


/* Initialise the LiquidCrystal library. Note that the displays will have a default I2C
    address of either 0x27 or 0x3F. Uncomment one of the lines below depending on
    the address of your module. */

//LiquidCrystal_I2C lcd(0x27,20,4);
LiquidCrystal_I2C lcd(0x3F,20,4);


void setup()
{
  /* Initialise the LCD */
  lcd.init();
  lcd.init();
}

/* Main program loop */
void loop()
{
  /* Make sure the backlight is turned on */
  lcd.backlight();

  /* Output the test message to the LCD */
  lcd.setCursor(0,0);
  lcd.print("HOBBY COMPONENTS");
  lcd.setCursor(0,1);
  lcd.print("**HELLO WORLD**");

 
  /* Do nothing */
  while(1);
}