Created
January 5, 2021 15:22
-
-
Save elktros/8ce88dcfe73a23c46ad8fcd73eb0ec45 to your computer and use it in GitHub Desktop.
Interfacing Nokia 5110 LCD with Arduino
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
#include <SPI.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_PCD8544.h> | |
/* Declare LCD object for software SPI | |
Adafruit_PCD8544(CLK,DIN,D/C,CE,RST);*/ | |
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3); | |
void setup() | |
{ | |
/* Initialize the Display*/ | |
display.begin(); | |
/* Change the contrast using the following API*/ | |
display.setContrast(57); | |
/* Clear the buffer */ | |
display.clearDisplay(); | |
/* Now let us display some text */ | |
display.setTextColor(WHITE, BLACK); | |
display.setCursor(4,8); | |
display.setTextSize(1); | |
display.println("|Electronics|"); | |
display.setCursor(28,20); | |
display.println("|Hub|"); | |
display.setCursor(12,32); | |
display.setTextColor(BLACK); | |
display.println("Nokia 5110"); | |
display.display(); | |
delay(1000); | |
} | |
void loop() | |
{ | |
/* You can implement your own display logic here*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment