Help, Connecting LCD ic2 to Arduino Nano

Hi, I'm trying to connect LCD ic2 with arduino nano, however, for SDA and SCL which supposed to be connected to the A4 and A5, I am unsure how to do this since all my anolog pins are being used to connect fsr sensors, A0-A7 (8 fsr sensors).

Is there any other way to connect it? I can't connect it to A4 and A5 now right since its already connected to the FSR sensor?

Please help, thank you.

Google "arduino software I2C" for several choices. I can't recommend any one as I have never used software I2C,

But software I2C comes with it's own pitfalls. One of them is that not every library is able to specify what to use.

Easy option would be to add an external (I2C) ADC :slight_smile:

You have 14 digital pins. Avoid D0, D1 because they are used by Serial.
That still leaves you with 12 GPIO pins. You need 6 for regular parallel 16x2.

Calculating your pin budget is the first part of any design.
It is easier and cheaper to select a controller with more legs than to add external chips.

David.

Use the SoftwareWire library for your soft i2c
Use my hd4480 library for the LCD.
Here is some example code to show you how to use them:

#include <SoftwareWire.h> 
const int sda=A0, scl=A1; // pick any pins you want for sda and scl
SoftwareWire Wire(sda,scl);
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
hd44780_I2Cexp lcd; // declare lcd object and let it auto-configure everything.

void setup()
{
int istatus;

  istatus = lcd.begin(16,2);
  if(istatus)
  {
 // LCD initalization failed.
 // handle it anyway you want
 if(istatus < 0)
 istatus = -istatus;
 lcd.fatalError(istatus); // blinks error if LED_BUILTIN is defined
  }
  lcd.print("Hello, World!");
}

void loop() { }

This creates a Wire object for the SoftwareWire library to allow it to be used instead of the Wire library Wire object.

--- bill