Go Down

Topic: problems programming pro mini (Read 990 times) previous topic - next topic

anking

trying to use example code for 2wire lcd here with pro mini

Code: [Select]
/* YourDuino.com Example Software Sketch
20 character 4 line I2C Display
terry@yourduino.com */

/*-----( Import needed libraries )-----*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 line display
LiquidCrystal_I2C lcd(0x27,20,4); 

/*-----( Declare Variables )-----*/


void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  Serial.begin(9600);
  lcd.init();                      // initialize the lcd

  // Print our characters on the LCD
  lcd.backlight();  //Backlight ON if under program control
  lcd.setCursor(3,0); //Start at character 3 on line 0
  lcd.print("Hello, world!");
  delay(1000);
  lcd.setCursor(2,1);
  lcd.print("From YourDuino");
  delay(1000); 
  lcd.setCursor(0,2);
  lcd.print("20 by 4 Line Display");
  lcd.setCursor(0,3);
  delay(2000);   
  lcd.print("http://YourDuino.com");

}/*--(end setup )---*/


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  {
    // when characters arrive over the serial port...
    if (Serial.available()) {
      // wait a bit for the entire message to arrive
      delay(100);
      // clear the screen
      lcd.clear();
      // read all the available characters
      while (Serial.available() > 0) {
        // display each character to the LCD
        lcd.write(Serial.read());
      }
    }
  }

}/* --(end main loop )-- */


/* ( THE END ) */

but when compiling I'm getting this:
Code: [Select]

LiquidCrystal_I2C2004V1\LiquidCrystal_I2C.cpp.o: In function `LiquidCrystal_I2C::expanderWrite(unsigned char)':
C:\programming\Arduino\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.cpp:260: undefined reference to `Wire'
C:\programming\Arduino\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.cpp:260: undefined reference to `Wire'
C:\programming\Arduino\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.cpp:260: undefined reference to `TwoWire::beginTransmission(unsigned char)'
LiquidCrystal_I2C2004V1\LiquidCrystal_I2C.cpp.o: In function `TwoWire::write(int)':
C:\programming\Arduino\libraries\Wire/Wire.h:72: undefined reference to `TwoWire::write(unsigned char)'
LiquidCrystal_I2C2004V1\LiquidCrystal_I2C.cpp.o: In function `LiquidCrystal_I2C::expanderWrite(unsigned char)':
C:\programming\Arduino\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.cpp:262: undefined reference to `TwoWire::endTransmission()'
LiquidCrystal_I2C2004V1\LiquidCrystal_I2C.cpp.o: In function `LiquidCrystal_I2C::init_priv()':
C:\programming\Arduino\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.cpp:68: undefined reference to `Wire'
C:\programming\Arduino\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.cpp:68: undefined reference to `Wire'
C:\programming\Arduino\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.cpp:68: undefined reference to `TwoWire::begin()'


where is the problem here?

anking

changed to this
Code: [Select]
#include <..\Wire\Wire.h>
now I'm only getting
LiquidCrystal_I2C.cpp: In member function 'void LiquidCrystal_I2C::init_priv()':
LiquidCrystal_I2C.cpp:67: error: 'Wire' was not declared in this scope
LiquidCrystal_I2C.cpp: In member function 'void LiquidCrystal_I2C::expanderWrite(uint8_t)':
LiquidCrystal_I2C.cpp:259: error: 'Wire' was not declared in this scope

Go Up