Here is the code I am using to check memory use of the "lean" library:
#include <Wire.h>
#include <LiquidTWI2.h>
// Connect via i2c, default address #0 (A0-A2 not jumpered)
LiquidTWI2 lcd(0);
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
void setup() {
Serial.begin(57600);
Serial.println(F("\n[memCheck]"));
Serial.println(freeRam());
// set the LCD type
lcd.setMCPType(LTI_TYPE_MCP23008);
// lcd.setMCPType(LTI_TYPE_MCP23017);
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(F("hello, world!"));
Serial.println(F("hello"));
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
lcd.setBacklight(HIGH);
delay(500);
lcd.setBacklight(LOW);
delay(500);
}
and here is the result in serial monitor:
[memCheck]
1607
Am I going about this the right way?