Giter Site home page Giter Site logo

glcd-library's Introduction

gLCD Library for Arduino 0022,0023, 1.0.[0 to 3], and 1.5.[0,1]

A library for Arduino which allows the communication of the Arduino with a Nokia 128px x 128px display such as those sold by SparkFun Electronics.
The library allows communication with both the Phillips and EPSON controllers, so should work with almost all of these screens(1).

Please see the example sketches and also the gLCD.h header file for extensive information as to what functions are in the library and how they work.


Ready-to-go library folders can be downloaded in ZIP format here:
https://github.com/TCWORLD/gLCD-Library/tree/master/Downloads


This library is released under the MIT License. Please refer the the file named LICENSE


The gLCD folder contains a copy of the current code version to allow the library to be cloned.


---------------------------------------------------------------------------------------
Current Version 3.5
---------------------------------------------------------------------------------------

Version 3.5 fixes a bug that prevented floating point (decimal) numbers being printed.


---------------------------------------------------------------------------------------
Version 3.3 onwards support rotating screens by either 0, 90, 180 or 270 degrees clockwise.

The rotation is specified by adding an extra variable to the end of the begin() call:
begin(Xzero, Yzero, InvertColour, driver, ROTATION_x)
where ROTATION_x is one of the following:
ROTATION_0
ROTATION_180
ROTATION_90
ROTATION_270

(If ROTATION_x is omitted, it will be assumed to be 0degrees so the new version is fully compatible with older versions)

Alternatively rotation can be set by calling:
setRotation(ROTATION_x);

For displays that use 0degree rotation, no remapping is required at all and so performance is the same as prior versions.
It should however be noted that rotating the screen by any other amount reduces the performance of the display
because the coordinates have to be remapped before being send to the screen. 

The impact is mostly confined to text and drawing lines.
Filling areas such as with Clear() or Box() doesn't require remapping so is unaffected by performance reduction.

---------------------------------------------------------------------------------------


Note 1: How to initialise screens on versions 3.x

For EPSON Displays:
---------------------------------------------------------------------------------------
begin(Xzero, Yzero, InvertColour,EPSON):
- Initialise the display. This may need changing for certain screens. Xzero and Yzero are (0,0) offset. Invert colour can be used if White appears as black, which it does on some displays.(1 = Invert, 0 = Normal)


For Phillips Displays:
---------------------------------------------------------------------------------------
begin(Xzero, Yzero, InvertColour, PHILLIPS_x) 
Where the x is a number between 0 and 3 inclusive which selects the correct phillips driver.
Choose from these four:
PHILLIPS_0
PHILLIPS_1
PHILLIPS_2
PHILLIPS_3
If you run the BasicFunctions sketch, then use trial and error to find the correct driver for your screen. Once you have found a driver which the text is not mirrored and is visible, you have found the correct one.

glcd-library's People

Contributors

tcworld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

glcd-library's Issues

Bug in print function?

Hi,
first of all thanks for this useful library, seems to be the only one working with Arduino 1.0 right now.
ISSUE (Version 2.2): Maybe there's a bug printing text with solid background - using the print function like this...

graphic.Print("Board mode: "+String(boardmode_val),10,30,4);

...results in a totally corrupted unreadable line. I'm using the Phillips sequence, screen inverted. Switching off inversion does not help, the issue stays the same. Changing font size in either or both directions still results in a corrupted line.
Tried to figure out what's wrong but hadn't any success, sorry.

Thanks for your help!

Errors while trying to compile example script

Hey there friends; first off let me thank you for all of the work you have done thus far on this project. I was pointed to this project by the comments on sparkfun.

I've got my screen wired up to a Teensy3.0 microcontroller and I'm using Arduino 1.0.2. When I try to compile the testpattern example; I got an error

C:\Users\Michael\Desktop\arduino-1.0.2\libraries\gLCD\gLCD.cpp: In constructor 'gLCD::gLCD(unsigned char, unsigned char, unsigned char, unsigned char, SpeedMode)':
C:\Users\Michael\Desktop\arduino-1.0.2\libraries\gLCD\gLCD.cpp:160: error: 'NOT_A_PIN' was not declared in this scope

I went into the .cpp file for the library and tried to find a reference for NOT_A_PIN and couldn't. I tried defining NOT_A_PIN as 0 and then got this error

gLCD\gLCD.cpp.o: In function `gLCD::mapWindowCoordinates(int&, int&, int&, int&)':
C:\Users\Michael\Desktop\arduino-1.0.2\libraries\gLCD/gLCD.cpp:347: undefined reference to `__cxa_guard_acquire'
C:\Users\Michael\Desktop\arduino-1.0.2\libraries\gLCD/gLCD.cpp:347: undefined reference to `__cxa_guard_release'
C:\Users\Michael\Desktop\arduino-1.0.2\libraries\gLCD/gLCD.cpp:348: undefined reference to `__cxa_guard_acquire'
C:\Users\Michael\Desktop\arduino-1.0.2\libraries\gLCD/gLCD.cpp:348: undefined reference to `__cxa_guard_release'
collect2: ld returned 1 exit status

Any idea's as to what I am doing wrong? I have tried both Phillips and Epson driver codes to no avail. I'd really love to get my screen working. Thanks!

Michael

Speed Mode

Hello, I'm trying to use the speed mode on the fourth version of the library with an arduino UNO and a nokia LCD shield.
I'm usin this pin set up:

const char RST = 7;
const char Dat = 6;
const char Clk = 5;
const char CS = 4;

and the only change I do is this:
gLCD graphic(RST,CS,Clk,Data,1); // gLCD graphic(RST,CS,Clk,Data,0)

When it's not on speed mode, LCD works perfectly, but whe I change it, it seems that only the backlight works.
The test pattern work fine also.

Problem writing strings with periods

I'm trying to display an IP address and several floating point numbers using the gLCD.print method. Printing all other text works as expected except as the examples show below.

graphic.print( Ethernet.localIP() ); // This prints the last octet at the chosen coordinates

float temp = 23.56;

graphic.print( temp ); // This prints 63 at the chosen coordinates

float temp = 23.42;
graphic.print( temp ); // This prints 23 at the chosen coordinates

I looked through the library and don't see anything that stands out as a likely cause. Any thoughts you have would be most appreciated.

Thanks for the great work on this library!

Tom

Window function problem for EPSON driver

Hi Tom,

My Nokia 6100 LCD is using EPSON controller.
When I use Plot function to draw 1 pixel, it will draw 2 dots on the screen. one is (x,y), another is (x,y+1) (y is in even number) or (x,y-1) (y is in odd number).
the page & column config is:
SendByte(_command, 0xBC); //Display Control
SendByte(_parameter, 0x07); //Scan direction (left-->right or right-->left)
SendByte(_parameter, 0x00); //RGB colour order
SendByte(_parameter, 0x02);

After I changed the scan direction to 0x03, switched the page and column, the 2 dots are (x,y) and (x+1,y) or (x-1,y).

Same problem in Line and Box function. Line function will draw a double width line, and the same as Box border.

I think may be the problem is in Window function, but I don't know how to fix it.
Thanks.

BR,
Wells.

Due Example / diagram

It would help alot to see an example using the Arduino Due pins (maybe with a wiring diagram that you used). Thanks for your consideration, Mike

Print an Image on PCF8833 Display

Hello!
I'd Like to know if there is any way to print a coloured Bitmap Image on a PCF8833 Controlled Display with this Library.

Thank you!

P.S. Sorry for my English but I'm Italian :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.