The Adafruit library also makes it very easy to display text to the Nokia 5110 LCD. The following code shows how we can display text:
// Display text display.setTextSize(1); display.setTextColor(BLACK); display.setCursor(0,0); display.println("Hello, world!"); // Display Reverse Text display.setTextColor(WHITE, BLACK); display.println(3.14); // Display Larger Text display.setTextSize(2); display.setTextColor(BLACK); display.print("This is larger text"); display.display();
The setTextSize() function sets the size of the text. In the first example, the text size is set to 1. The setTextColor() function will set the color of the text. Once again, since the Nokia 5110 LCD is a monochrome display, the two options are BLACK or ...