Go Down

Topic: M2TKLIB Hello World with LiquidCrystal_I2C (Read 4 times) previous topic - next topic

olikraus


digimate


ok, thanks.

I have created issue 98 for this: http://code.google.com/p/m2tklib/issues/detail?id=98

Oliver


Much appreciated.  As a beginner, I wasn't sure of the situation with all the various libraries and hardware surrounding the Arduino.   It can all be a bit confusing, but all the support that is available is great.

olikraus

I added the New LiquidCrystal Library (https://bitbucket.org/fmalpartida/new-liquidcrystal/) as output engine to M2tklib.
A first beta release for the New LiquidCrystal Library is available for download: http://code.google.com/p/m2tklib/downloads/list

Oliver

digimate


I added the New LiquidCrystal Library (https://bitbucket.org/fmalpartida/new-liquidcrystal/) as output engine to M2tklib.
A first beta release for the New LiquidCrystal Library is available for download: http://code.google.com/p/m2tklib/downloads/list

Oliver


Thanks.  I just downloaded it and am trying to understand how to make the Hello World example work with my I2C display.  Firstly I had to include Wire.h to get it to compile.   

Then I tried to convert it to I2C by including the different library and changing how the lcd object was created (and changing the setup to 20x4 from 16x2)

Code: [Select]
#include <Wire.h>
//#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
#include "M2tk.h"
#include "utility/m2ghnlc.h"


LiquidCrystal_I2C lcd(0x3F);

M2_LABEL(hello_world_label, NULL, "Hello World!");
M2tk m2(&hello_world_label, NULL, NULL, m2_gh_nlc);

void setup() {
  m2_SetNewLiquidCrystal(&lcd, 20, 4);
}

void loop() {
  m2.draw();
  delay(500);
}


This is producing these errors

Quote
In file included from HelloWorld.pde:42:
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: variable or field 'm2_SetNewLiquidCrystal' declared void
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: 'LCD' was not declared in this scope
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: 'lc_ptr' was not declared in this scope
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: expected primary-expression before 'cols'
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: expected primary-expression before 'rows'
HelloWorld:45: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int)'
/home/myhome/sketchbook/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.h:57: note: candidates are: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)
/home/myhome/sketchbook/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.h:55: note:                 LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)
HelloWorld.pde: In function 'void setup()':
HelloWorld:51: error: 'm2_SetNewLiquidCrystal' was not declared in this scope



So assuming I just don't understand :)  I thought it was time to ask advice.

olikraus

Hi

Well, as far as possible, i tested this release in my environment. So, this is what i did:

1. Install a fresh Arduino IDE (I have used 1.0.3)
2. Download LiquidCrystal_V1.2.1.zip from https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
  It is really important to use LiquidCrystal_V1.2.1.zip, which contains the base class LCD ( this was missing in on your PC).
3. In your installation directory, located the libraries folder. Extract LiquidCrystal_V1.2.1.zip in that folder. Among others
  this will overwrite the original LiquidCrystal Library.
4. Install m2tklib and update the example as you already did. Now it should compile.

Oliver

Go Up