Skip to content

Commit

Permalink
v 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinlyonsrepo committed Jun 16, 2023
1 parent 361006a commit f8f9daa
Show file tree
Hide file tree
Showing 13 changed files with 1,126 additions and 999 deletions.
File renamed without changes.
46 changes: 28 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@

# NOKIA5110_TEXT

Table of contents
---------------------------
## Table of contents

* [Overview](#overview)
* [Tested](#tested)
* [Output](#output)
* [Installation](#installation)
* [Hardware](#hardware)
* [SPI](#spi)
* [Software](#software)
* [API](#api)
* [Fonts](#fonts)
* [Bitmaps](#bitmaps)
* [Print](#print)


Overview
--------------------
## Overview

* Name : NOKIA5110_TEXT
* Title : Library for Nokia 5110 LCD (PCD8544 controller) for the Arduino eco-system
* Description :
Expand All @@ -36,8 +41,8 @@ basic graphics patterns can be created using custom characters, pixels, block pa
* Author: Gavin Lyons


Tested
-----------------------------
## Tested

* Tested on following MCUs (The file testedMCU_pinouts.txt in extras folder, shows pins used in testing)

1. Arduino UNO & NANO v3
Expand All @@ -47,8 +52,8 @@ Tested
5. ATtiny85
6. Arduino UNO R4 minima

Output
---------------------------------
## Output


Output Screenshots, From left to right top to bottom.

Expand All @@ -65,14 +70,14 @@ Output Screenshots, From left to right top to bottom.

![ font pic 3 ](https://github.com/gavinlyonsrepo/NOKIA5110_TEXT/blob/master/extras/image/NOKIA_FONT_ALL.jpg)

Installation
------------------------------
## Installation


The library is included in the official Arduino library manger and the optimum way to install it
is using the library manager.

Hardware
-------------------------
## Hardware

The Nokia 5110 is a basic LCD screen for lots of applications.
It was originally intended to be used as a mobile phone screen.
It uses the PCD8544 controller, which is the same used in the Nokia 3310 LCD.
Expand Down Expand Up @@ -102,7 +107,7 @@ The example files use Pin D2-RST <.....> D6-CLK for UNO.
| Digital GPIO | LCD_CE Pin 2 chip enable |
| Digital GPIO | LCD_RST Pin 1 reset|

**SPI interface bus**
### SPI

The PCD8544 interfaces to microcontrollers through a serial bus interface(SPI).
The library originally and by default used software SPI.
Expand All @@ -121,10 +126,15 @@ Pinout of a Nokia 5110 LCD.

The LCD Vcc runs at 3.3V so you'll need to use level shifting/dropping to use with safely with 5V microcontroller.

Software
---------------------------
## Software

### API

The API (application programming interface) documentation is at link hosted on github pages and generated by Doxygen.

[API URL](https://gavinlyonsrepo.github.io/misc/software_docs/NOKIA5110_TEXT/index.html)

**Fonts**
### Fonts

There are 9 fonts.
By default only Font 1 is commented in and ready to go.
Expand Down Expand Up @@ -154,11 +164,11 @@ Font table:
| 8 | Huge | 16x24 | 10 | Numbers + : . only, use / for space | 832 |
| 9 | Mega | 16x32 | 5 | Numbers + : . only, use / for space | 832 |

**Bitmaps**
### Bitmaps

Libray can display bitmaps, Data in bitmaps must be vertically addressed and can be placed in PROGMEM, see examples files.

**Print method**
### Print

There is a print method which utilises the arduino print.h
to print data types other than character strings
Expand Down
15 changes: 10 additions & 5 deletions examples/NOKIA5110_BITMAP/NOKIA5110_BITMAP.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// NOKIA5110_BITMAP.ino
// Test file for NOKIA5110_TEXT showing how to fill entire screen with a bitmap 84 * 48 = 504 bytes,software SPI
// URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT
/*!
@file NOKIA5110_BITMAP.ino
@brief Test file for NOKIA5110_TEXT showing how to fill display bitmap's, software SPI
@details URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT
@test
-# Test 31 bitmap 84x48px Full Screen
-# Test 32 bitmap 84x24px half screen
*/

// Include the library
#include <NOKIA5110_TEXT.h>
Expand All @@ -21,7 +26,7 @@ NOKIA5110_TEXT mylcd(RST, CE, DC, DIN, CLK);
#define contrast 0xB2 // default is 0xBF set in LCDinit, Try 0xB1 - 0xBF if your display is too dark/dim
#define bias 0x13 // LCD bias mode 1:48: Try 0x12 , 0x13 or 0x14

// 'image1 , snake splashscreen', 84x48px Full Screen data vertical addressed
/**< 'image1 , snake splashscreen', 84x48px Full Screen data vertical addressed */
const PROGMEM unsigned char mybitmap[504] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xf8, 0x7c,
0x7c, 0x20, 0x00, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0x80, 0x00, 0x00, 0xe0, 0xf8, 0xf8, 0xfc, 0x38,
Expand Down Expand Up @@ -57,7 +62,7 @@ const PROGMEM unsigned char mybitmap[504] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

// 'image2 lighting symbols', 84x24px half screen, data vertical addressed
/**< 'image2 lighting symbols', 84x24px half screen, data vertical addressed */
const PROGMEM unsigned char mybitmap2[252] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x7f, 0x3f, 0x3f, 0x1f, 0x0f, 0x0f, 0x07, 0x87, 0xc3, 0xe3, 0xf9, 0xfd, 0xff, 0xff, 0xff,
Expand Down
41 changes: 19 additions & 22 deletions examples/NOKIA5110_FONTS/NOKIA5110_FONTS.ino
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
// Test file for NOKIA5110_TEXT showing all 9 fonts. 1-9
//
// URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT
//
// NOTE ************ README NB NB ********************** NOTE:
//
// There are Nine fonts , font one is default,
// For a non-default font to work , One line in the library header file
// called "NOKIA5110_TEXT_FONT_DATA.h" Must be modified by USER
// the Define statement at start of file for Font X must be commented IN.
// #define NOKIA5110_FONT_X where X is name of font in FONT DEFINE SECTION.
// Tests will not work fully if non-default fonts are not commented in, nothing will appear.
// For all this example file to work fully all fonts must be commented in
// NOTE *************** README NB NB ************************ NOTE:
/*!
@file NOKIA5110_FONTS.ino
@brief Test file for NOKIA5110_TEXT showing all 9 fonts. 1-9, software SPI
@note
-# There are Nine fonts , font one is default,
-# For a non-default font to work , One line in the library header file
-# called "NOKIA5110_TEXT_FONT_DATA.h" Must be modified by USER
-# the Define statement at start of file for Font X must be commented IN.
-# define NOKIA5110_FONT_X where X is name of font in FONT DEFINE SECTION.
-# Tests will not work fully if non-default fonts are not commented in, nothing will appear.
-# For all this example file to work fully all fonts must be commented in
@details URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT
@test
-# TEST 1 font 1-6, X by 8 fonts
-# TEST 2 font 7, 12 by 16 font
-# TEST 3 font 8, 16 by 24 font
-# TEST 4 font 9, 16 by 32 font
*/

// Include the library.
#include <NOKIA5110_TEXT.h>
Expand All @@ -29,7 +33,7 @@
NOKIA5110_TEXT mylcd(RST, CE, DC, DIN, CLK);

#define inverse false
#define contrast 0xBF // default is 0xBF set in LCDinit, Try 0xB1 - 0xBF if your display is too dark
#define contrast 0xBF // default is 0xBF set in LCDinit, Try 0xB1 - 0xBF if your display is too dark/dim
#define bias 0x12 // LCD bias mode 1:48: Try 0x12, 0x13 or 0x14

// TEST delays
Expand All @@ -53,13 +57,6 @@ void setup() {

// *********** MAIN LOOP ***********
void loop() {
/*
TEST 1 font 1-6, X by 8 fonts
TEST 2 font 7, 12 by 16 font
TEST 3 font 8, 16 by 24 font
TEST 4 font 9, 16 by 32 font
*/

Test1();
Test2();
Test3();
Expand Down
10 changes: 7 additions & 3 deletions examples/NOKIA5110_HELLOWORLD/NOKIA5110_HELLOWORLD.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// NOKIA5110_HELLOWORLD.ino
// Test file for NOKIA5110_TEXT showing use most basic use case "HELLO WORLD" at 0,0 with font number one, software SPI.(defaults) for arduino UNO
// URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT
/*!
@file NOKIA5110_HELLOWORLD.ino
@brief Test file for NOKIA5110_TEXT showing use most basic use case "HELLO WORLD" at 0,0 with font number one, software SPI.(defaults) for arduino UNO
@details URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT
@test
-# Test 0 Display Hello world
*/

// Include the library
#include <NOKIA5110_TEXT.h>
Expand Down
15 changes: 13 additions & 2 deletions examples/NOKIA5110_HWSPI/NOKIA5110_HWSPI.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@



// NOKIA5110_HW_SPI.ino
// HARDWARE SPI
// Test file for NOKIA5110_TEXT showing use most basic use case "HELLO WORLD" at 0,0 with font number one using Hardware SPI on an arduino UNO.
// ***************NB NB NOTE **********************
// Software SPI is the orginal and default setup. For hardware SPI to work the library must be modified:
// In file NOKIA5110_TEXT.h , SPI HARDWARE SECTION , comment in #define SPIHW_ON, it is commented out by default
// Software SPI is the orginal and default setup.
//****************************************************
// URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT

/*!
@file NOKIA5110_HWSPI.ino
@brief Test file for NOKIA5110_TEXT showing use most basic use case "HELLO WORLD" at 0,0 with font number one, hardware SPI for arduino UNO
@details URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT
@note For hardware SPI to work the library must be modified: In file NOKIA5110_TEXT.h , SPI HARDWARE SECTION , comment in #define SPIHW_ON, it is commented out by default
@test
-# Test 0-B Display Hello world Hardware SPI
*/

// Include the library
#include <NOKIA5110_TEXT.h>

Expand Down
Loading

0 comments on commit f8f9daa

Please sign in to comment.