Go Down

Topic: LCD Bitmap - Updated v1.6 (Read 8248 times) previous topic - next topic

bperrybap


Compatible with Arduino 0023.


The examples will not work "as is" with releases prior to 1.0 because of the .ino extension.
If you renamed them to .pde then the examples could work "out of the box" with both
the the post and pre 1.0 releases.

--- bill



Compatible with Arduino 0023.


The examples will not work "as is" with releases prior to 1.0 because of the .ino extension.
If you renamed them to .pde then the examples could work "out of the box" with both
the the post and pre 1.0 releases.

--- bill


Thanks!  That's why the sketches weren't listed in 0023.  I just did a cut and paste to test because for "whatever" reason it wouldn't load.  Now the mystery has been answered.  I'll make the changes for the next release.

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

yadirgan

Hi,

I have installed arduino 1.0.1 and I just downloaded LCDBitmap library . I loaded the LCDBitmap_standard_4bit example and try to compile it.

This is the outcome:

/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:89:17: error: LCD.h: not found
In file included from LCDBitmap_Standard_4bit.cpp:2:
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:110: error: expected `)' before '*' token
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:133: error: ISO C++ forbids declaration of 'LCD' with no type
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:133: error: expected ';' before '*' token
LCDBitmap_Standard_4bit:4: error: no matching function for call to 'LCDBitmap::LCDBitmap(LiquidCrystal*, int, int)'
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:108: note: candidates are: LCDBitmap::LCDBitmap()
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:108: note:                 LCDBitmap::LCDBitmap(const LCDBitmap&)

The first line shows a LCD.h not found statement... where LCD.h header is?. Am I missing something?.

any advice will be appreciated.

Regards

YADL

fm

You will need to download the "New LiquidCrystal" library, aka, the LCD library:
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
   

bperrybap

#34
Jun 21, 2012, 08:28 pm Last Edit: Jun 21, 2012, 08:30 pm by bperrybap Reason: 1
Tim,
maybe to help newbies, you could add a compile time check/error to tell them how to resolve the issue.
For example, LCDBitmap.h includes <LiquidCrystal.h>
fm's LiquidCrystal.h includes "LCD.h" so the include of "LCD.h" is not needed in LCDBitmap.h
(This will eliminate the preprocessor error).

Then instead of the include for LCD.h
do a compile time check for a define that is only in fm's library.
Something like maybe:

Code: [Select]
#ifndef BACKLIGHT_ON
#error You need to install this version of the LiquidCrystal library: https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
#endif


(hint... hint...) maybe it would be useful to have a more unique define that could be checked
to compile time detect the existence/use of the replacement LiquidCrystal replacement library...


--- bill


Hi,

I have installed arduino 1.0.1 and I just downloaded LCDBitmap library . I loaded the LCDBitmap_standard_4bit example and try to compile it.

This is the outcome:

/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:89:17: error: LCD.h: not found
In file included from LCDBitmap_Standard_4bit.cpp:2:
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:110: error: expected `)' before '*' token
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:133: error: ISO C++ forbids declaration of 'LCD' with no type
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:133: error: expected ';' before '*' token
LCDBitmap_Standard_4bit:4: error: no matching function for call to 'LCDBitmap::LCDBitmap(LiquidCrystal*, int, int)'
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:108: note: candidates are: LCDBitmap::LCDBitmap()
/home/ydirgan/SCRIPTS/Arduino/arduino-1.0.1/libraries/LCDBitmap/LCDBitmap.h:108: note:                 LCDBitmap::LCDBitmap(const LCDBitmap&)

The first line shows a LCD.h not found statement... where LCD.h header is?. Am I missing something?.

any advice will be appreciated.

Regards

YADL



I guess I missed this.  I had believed LCDBitmap would work without the "New LiquidCrystal" library.  But, that doesn't seem to be the case.  Attached to this message are replacement library files.  Save and replace these files with the existing files in your Arduino/libraries/LCDBitmap/ folder.  I don't have a 4bit project in front of me to test, but the attached files do compile with a stock Arduino 1.0.1 with the LCDBitmap_Standard_4bit sketch.

Let me know if it works.

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone


Tim,
maybe to help newbies, you could add a compile time check/error to tell them how to resolve the issue.
For example, LCDBitmap.h includes <LiquidCrystal.h>
fm's LiquidCrystal.h includes "LCD.h" so the include of "LCD.h" is not needed in LCDBitmap.h
(This will eliminate the preprocessor error).


Actually, when using a 4bit connection the LCDBitmap library was supposed to work without the need for the New LiquidCrystal library.  I've changed the code so it should work with or without the New LiquidCrystal library and attached the revision to my previous reply.

Adding an error if trying to use other connection types without the New LiquidCrystal library is a good idea too, and I'll probably be implementing that as well.

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

yadirgan

Thanks, it worked!.

I had changed the LCD reference for LiquidCrystal and of course it worked, but nice to have the latest files with the conditionals.

Regards

YADL


Thanks, it worked!.

I had changed the LCD reference for LiquidCrystal and of course it worked, but nice to have the latest files with the conditionals.

Regards

YADL


Thanks for testing.  I'll incorporate that in the next release.

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

Hydromea

Hi, thanks for this great library. I got it working successfully using an Arduino Leonardo, running IDE v1.0.1, with your modified version of the library attached on an above post. However, I've been playing around with the bars function and can't figure out: How could I use your library to display the value (graphical) of some analog inputs? Suppose I have 3 analog inputs. I read them, re-map or convert them, and display those values with a bar, with the highest possible value creating a full bar, and the lowest possible value giving an empty bar. Any help or suggestions would be great.


Hi, thanks for this great library. I got it working successfully using an Arduino Leonardo, running IDE v1.0.1, with your modified version of the library attached on an above post. However, I've been playing around with the bars function and can't figure out: How could I use your library to display the value (graphical) of some analog inputs? Suppose I have 3 analog inputs. I read them, re-map or convert them, and display those values with a bar, with the highest possible value creating a full bar, and the lowest possible value giving an empty bar. Any help or suggestions would be great.


The barGraph method is fairly straight-forward, the syntax is as follows:

bitmap.barGraph(bars, *graph, color, update);

<bars> is the number of bar graphs you want to display.
<graphics> is an array of height values (these values are in pixels, with the range from 0 to 16).
<color> is either ON or OFF.
<update> is etiher UPDATE or NO_UPDATE (in the next release, v1.5, all functions default to NO_UPDATE if not specified).

So, if you want 3 bar graphs for your 3 analog sensors, you would do something like this:

Code: [Select]
#include <LiquidCrystal.h>
#include <LCDBitmap.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LCDBitmap bitmap(&lcd, 0, 0);  // Set the bitmap to the &lcd display at character position 0,0.
byte graph[3]; // Bar graph with 3 columns.

int analogPin1 = A1;
int analogPin2 = A2;
int analogPin3 = A3;

void setup() {
  lcd.begin(16,2); // Initalize the LCD display, do this before you initalize LCDBitmap.
  bitmap.begin();  // Then initalize the LCD bitmap.
}

void loop() {
  // analogRead returns values from 0 to 1023, the barGraph displays values from 0 to 16 (1023+13)/61=16.98.
  // This does the conversion without using floating point math keeping your compiled code small.
  graph[0] = (analogRead(analogPin1) + 13) / 61;
  graph[1] = (analogRead(analogPin2) + 13) / 61;
  graph[2] = (analogRead(analogPin3) + 13) / 61;
  bitmap.barGraph(3, graph, ON, UPDATE);  // Display the bar graph.
  delay(50);
}


Note: code compiles, but is untested.

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

#41
Jun 28, 2012, 09:40 pm Last Edit: Jun 28, 2012, 09:42 pm by teckel Reason: 1
Version 1.5 released:

4bit method now works without the New LiquidCrystal library (was always supposed to work this way, oversight on my part). Update switch now optional on all functions, defaults to NO_UPDATE.

Download LCDBitmap Library v1.5

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

duality

You are awesome! I was thinking of this a couple of weeks ago!
It's like  you read my mind  ;)

I am going to try this out!
I had made this myself:
http://freeduality.tk/?page_id=16
a lcd controled by a IO expander.
and had written a library for it,
you say your code works with the standard lcd library :)?

I'll give it a try with my code tomorrow and will let you know :)

just can\t say it enough, this is so awesome!   :)

greetings,
Duality
http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk


You are awesome! I was thinking of this a couple of weeks ago!
It's like  you read my mind  ;)

I am going to try this out!
I had made this myself:
http://freeduality.tk/?page_id=16
a lcd controled by a IO expander.
and had written a library for it,
you say your code works with the standard lcd library :)?

I'll give it a try with my code tomorrow and will let you know :)

just can\t say it enough, this is so awesome!   :)

greetings,
Duality


LCDBitmap works with the standard LiquidCrystal library if your LCD connection is standard 4-bit parallel (6 wires).  If your LCD's connection is I2C or uses a shift register, you'll also need the New LiquidCrystal library in addition to the LCDBitmap library.

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

LCDBitmap updated to version 1.6.  This is a small update that fixes a range checking bug.  As the library is very stable at this point, I'll probably start working on a different method of bitmap storage to save SRAM space.  Download the new version from the link below:

LCDBitmap Library v1.6 Download

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

Go Up