-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24be381
commit a597d69
Showing
12 changed files
with
220 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// 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 | ||
//**************************************************** | ||
// URL: https://github.com/gavinlyonsrepo/NOKIA5110_TEXT | ||
|
||
// Include the library | ||
#include <NOKIA5110_TEXT.h> | ||
|
||
// LCD Nokia 5110 pinout left to right | ||
// RST / CE / DC / DIN / CLK / VCC /LIGHT / GND | ||
#define RST 2 | ||
#define CE 3 | ||
#define DC 4 | ||
//DIN hardware SPI (UNO 11) MOSI | ||
//CLK hardware SPI (UNO 13) SCK | ||
|
||
// Create an LCD object | ||
NOKIA5110_TEXT mylcd(RST, CE, DC); | ||
|
||
#define inverse false // set to true to invert display pixel color | ||
#define contrast 0xB2 // default is 0xBF set in LCDinit, Try 0xB1 <-> 0xBF if your display is too dark | ||
#define bias 0x13 // LCD bias mode 1:48: Try 0x12 or 0x13 or 0x14 | ||
#define FontNumber 1 // 1-9, 1 is default, Comment in defines at top of NOKIA5110_TEXT.h if using non default | ||
|
||
void setup() { | ||
delay(500); | ||
mylcd.LCDInit(inverse, contrast, bias); // init the lCD | ||
mylcd.LCDClear(0x00); // Clear whole screen | ||
} | ||
|
||
void loop() { | ||
mylcd.LCDFont(FontNumber); // Set the font | ||
mylcd.LCDgotoXY(0, 0); // (go to (X , Y) (0-84 columns, 0-5 blocks) top left corner | ||
mylcd.LCDString("HELLO WORLD"); // print | ||
mylcd.LCDgotoXY(0, 2); | ||
mylcd.LCDString("HW SPI TEST"); // print | ||
delay(1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,44 @@ | ||
//Working pinouts used during testing | ||
// Working pinouts used during testing software SPI | ||
|
||
Arduino UNO | ||
NOKIA5110_TEXT mylcd(2, 3, 4, 5, 6); | ||
|
||
STM32 blue pill STM32F103C8T6 NOKIA5110_TEXT mylcd(PA0, PA1, PA2, PA3, PA4); | ||
ESP32 NOKIA5110_TEXT mylcd(23, 22, 21, 19, 18) or NOKIA5110_TEXT mylcd(23, 32, 33, 19, 18); | ||
ESP8266 NOKIA5110_TEXT mylcd(D2, D1, D6, D7, D5); | ||
ATtiny85 NOKIA5110_TEXT mylcd(PB0, PB1, PB2, PB3, PB4); | ||
STM32 blue pill STM32F103C8T6 | ||
NOKIA5110_TEXT mylcd(PA0, PA1, PA2, PA3, PA4); | ||
|
||
ESP32 | ||
NOKIA5110_TEXT mylcd(23, 22, 21, 19, 18) or NOKIA5110_TEXT mylcd(23, 32, 33, 19, 18); | ||
|
||
ESP8266 | ||
NOKIA5110_TEXT mylcd(D2, D1, D6, D7, D5); | ||
|
||
ATtiny85 | ||
NOKIA5110_TEXT mylcd(PB0, PB1, PB2, PB3, PB4); | ||
|
||
|
||
//****************************************************** | ||
|
||
// Working pinouts used during testing hardware SPI | ||
|
||
Arduino UNO | ||
#define RST 2 | ||
#define CE 3 | ||
#define DC 4 | ||
//DIN hardware SPI (UNO 11) MOSI | ||
//CLK hardware SPI (UNO 13) SCK | ||
NOKIA5110_TEXT mylcd(RST, CE, DC); | ||
|
||
ESP8266 | ||
// SCK = D5 HSCLK | ||
// SDA = D7 HMosi | ||
NOKIA5110_TEXT mylcd(D2, D1, D6); | ||
|
||
ESP32 | ||
// SCK = V_SPI_CLK D18 | ||
// SDA = V_SPI_D D23 | ||
NOKIA5110_TEXT mylcd(4, 27, 15); | ||
|
||
STM32 blue pill STM32F103C8T6 | ||
// SCK = PA5 SCK1 SCK | ||
// SDA = PA7 MOSI1 SDA | ||
NOKIA5110_TEXT mylcd(PA0, PA1, PA2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name=NOKIA5110_TEXT | ||
version=2.1.0 | ||
version=2.2.0 | ||
author=Gavin Lyons <[email protected]> | ||
maintainer=Gavin Lyons <[email protected]> | ||
sentence=NOKIA5110_TEXT is a light-weight library to display ASCII text on Nokia 5110 LCD PCD8544 controller. | ||
paragraph=It displays ASCII Text and is designed for low memory footprint. 96 characters can be displayed with smallest font, Sleep mode included. 9 optional fonts of various sizes, Inverse mode, contrast and bias control. Custom character and bitmap display, Basic Graphics. | ||
paragraph=It displays ASCII Text and is designed for low memory footprint. 96 characters can be displayed with smallest font. Five characters can be displayed with largest font. Sleep mode included. 9 optional fonts of various sizes and styles, Inverse mode, contrast and bias control. Custom characters and bitmap display, Basic Graphics. Hardware or Software SPI. | ||
category=Display | ||
url=https://github.com/gavinlyonsrepo/NOKIA5110_TEXT | ||
architectures=* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.