Skip to content

Instantly share code, notes, and snippets.

@elktros
Created January 5, 2021 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elktros/8ce88dcfe73a23c46ad8fcd73eb0ec45 to your computer and use it in GitHub Desktop.
Save elktros/8ce88dcfe73a23c46ad8fcd73eb0ec45 to your computer and use it in GitHub Desktop.
Interfacing Nokia 5110 LCD with Arduino
#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