Digital pin pulsating when not needed to


I’ve the following working code which is generating pulses on Yun’s digital pin 2. Because I need to use that pin, I’m using I2C board to comunicate with the LCD board to free Yun’s digitals pins.

Someone can please tell me how to stop pin 2 from pulsating?

As I understand it, line
LiquidCrystal_I2C lcd(dir, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
doesn’t affect the digital pins out on Yun’s board.


#include <Wire.h>
#include <LiquidCrystal_I2C.h>

byte dir = 0x27;   // I2C hexadecimal address
LiquidCrystal_I2C lcd(dir, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // set address and pins

void setup()   {
  lcd.begin(20, 4); // set LCD type/size

void loop() {
  lcd.clear(); // clear display
  lcd.setCursor(1, 0); // set curson
  lcd.print("Hello World");
  delay (2000);
  lcd.setCursor(3, 1); 
  lcd.print("What's up?");
  delay (1000);

Which version of that library are you using?

The versions of that LCD that I can find only take 3 arguments to the initializer, you've got a ton (as if you were passing all the arguments that would be used for a non-I2C LCD)...

wire library uses pin 2 as the sda on the yuns I believe.

Oh, well, that would do it. For some reason I thought the Yun used the '328p not the 32u4.

digital pins 2 and 3 are used by I2C. You do know that you can use "analog pins" as digital pins, right?

And that initializer still doesn't make any sense for an I2C LCD.